Numpy has "integer array indexig", which allows to index ndarray with other ndarray or list:
>> A = np.arange(10,20)
>> A[[1,2,3]]
Out[14]: array([11, 12, 13])
Suppose I don't know what is A, which can be either ndarray or Python's list.
Is there any explicit indexing function in numpy, which would allow the same indexing and accept both types?
For example:
>> A = np.arange(10,20)
>> np.get_elements(A, [1,2,3])
Out[14]: array([11, 12, 13])
>> A = range(10,20)
>> np.get_elements(A, [1,2,3])
Out[15]: [11, 12, 13]
numpy.take.Ais an array (egasarday(A)).operator.itemgetter