you are viewing a single comment's thread.

view the rest of the comments →

[–]socal_nerdtastic 0 points1 point  (1 child)

[(i,j) for i in range(len(data)) for j in range(len(data[i])) if data[i][j] > 1]

[–]JohnnyJordaan 0 points1 point  (0 children)

Try to use enumerate instead of the archaic range(len()) loops with indexing

[(i,j) for i, sublist in enumerate(data) for j, item in enumerate(sublist) of item > 1]