How to find the index of an array within an array

后端 未结 3 1738
一生所求
一生所求 2021-01-03 01:18

I have created an array in the way shown below; which represents 3 pairs of co-ordinates. My issue is I don\'t seem to be able to find the index of a particular pair of co-o

3条回答
  •  清酒与你
    2021-01-03 02:03

    index() is a method of the type list, not of numpy.array. Try:

    R.tolist().index(x)
    

    Where x is, for example, the third entry of R. This first convert your array into a list, then you can use index ;)

提交回复
热议问题