0

The following code

arr_0 = numpy.zeros((3,3))
arr_0[(0,0)] = 1
ind = numpy.where(arr_0 == 0)
print(ind)

gives the following output

(array([0, 0, 1, 1, 1, 2, 2, 2], dtype=int64), array([1, 2, 0, 1, 2, 0, 1, 2], dtype=int64))

The output is a list of x's and then a list of y's, and I would like a list of tuples (x,y), something like: [[0,1],[0,2], ...]. How can I do that ?

arnold_107
  • 43
  • 1
  • 4

0 Answers0