[docs]deftake(x:Array,indices:Array,/,*,axis:Optional[int]=None)->Array:""" Get the specified elements of an array along an axis. Parameters ---------- x : Array The array from which to take elements indices : Array A 1D integer array of indices to take from `x` axis : int, optional The axis along which to take elements. If None, `x` must be 1D. """ifaxisisNoneandx.ndim!=1:raiseValueError("axis must be specified for multidimensional arrays")ifindices.ndim!=1:raiseValueError("indices must be 1D")ifaxisisNone:axis=0repMsg=generic_msg(cmd=f"takeAlongAxis<{x.dtype},{indices.dtype},{x.ndim}>",args={"x":x._array,"indices":indices._array,"axis":axis,},)returnArray._new(create_pdarray(repMsg))