row_indices, col_indices = np.nonzero(both_top_n)
print('The following elements are in the top {} of both their rows and columns:'.format(
    n))
for row, column in zip(row_indices, col_indices):
    pass
Как найти расположение элементов в массиве numpy