numpy.take()

numpy.take

numpy.take(a, indices, axis=None, out=None, mode='raise') [source]

Take elements from an array along an axis.

This function does the same thing as “fancy” indexing (indexing arrays using arrays); however, it can be easier to use if you need elements along a given axis.

Parameters:

a : array_like

The source array.

indices : array_like

The indices of the values to extract.