class numpy.generic

Base class for numpy scalar types.

Class from which most (all?) numpy scalar types are derived. For consistency, exposes the same API as ndarray, despite many consequent attributes being either “get-only,” or completely irrelevant. This is the class from which it is strongly suggested users should derive custom scalar types.


all(a[, axis, out]) Test whether all array elements along a given axis evaluate to True.
any(a[, axis, out]) Test whether any array element along a given axis evaluates to True.
argmax(a[, axis]) Indices of the maximum values along an axis.
argmin(a[, axis]) Return the indices of the minimum values along an axis.
argsort(a[, axis, kind, order]) Returns the indices that would sort an array.
choose(a, choices[, out, mode]) Construct an array from an index array and a set of arrays to choose from.
clip(a, a_min, a_max[, out]) Clip (limit) the values in an array.
compress(condition, a[, axis, out]) Return selected slices of an array along given axis.
conj() Return the complex conjugate, element-wise.
conjugate() Return the complex conjugate, element-wise.
copy(a) Return an array copy of the given object.
cumprod(a[, axis, dtype, out]) Return the cumulative product of elements along a given axis.
cumsum(a[, axis, dtype, out]) Return the cumulative sum of the elements along a given axis.
diagonal(a[, offset, axis1, axis2]) Return specified diagonals.
max(a[, axis, out]) Return the maximum of an array or maximum along an axis.
mean(a[, axis, dtype, out]) Compute the arithmetic mean along the specified axis.
min(a[, axis, out]) Return the minimum of an array or minimum along an axis.
nonzero(a) Return the indices of the elements that are non-zero.
prod(a[, axis, dtype, out]) Return the product of array elements over a given axis.
ptp(a[, axis, out]) Range of values (maximum - minimum) along an axis.
put(a, ind, v[, mode]) Replaces specified elements of an array with given values.
ravel(a[, order]) Return a flattened array.
repeat(a, repeats[, axis]) Repeat elements of an array.
reshape(a, newshape[, order]) Gives a new shape to an array without changing its data.
resize(a, new_shape) Return a new array with the specified shape.
round(a[, decimals, out]) Round an array to the given number of decimals.
searchsorted(a, v[, side]) Find indices where elements should be inserted to maintain order.
sort(a[, axis, kind, order]) Return a sorted copy of an array.
squeeze(a) Remove single-dimensional entries from the shape of an array.
std(a[, axis, dtype, out, ddof]) Compute the standard deviation along the specified axis.
sum(a[, axis, dtype, out]) Sum of array elements over a given axis.
swapaxes(a, axis1, axis2) Interchange two axes of an array.
take(a, indices[, axis, out, mode]) Take elements from an array along an axis.
trace(a[, offset, axis1, axis2, dtype, out]) Return the sum along diagonals of the array.
transpose(a[, axes]) Permute the dimensions of an array.
var(a[, axis, dtype, out, ddof]) Compute the variance along the specified axis.

Previous topic


Next topic


This Page