Array manipulation routines

Basic operations copyto(dst, src[, casting, where]) Copies values from one array to another, broadcasting as necessary. Changing array shape reshape(a, newshape[, order]) Gives a new shape to an array without changing its data. ravel(a[, order]) Return a contiguous flattened array. ndarray.flat A 1-D iterator over the array. ndarray.flatten([order]) Return a copy of the array collapsed into one dimension. Transpose-like operations moveaxis(a, source, destination) Move axes of an arra

generic.round()

generic.round() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also The

numpy.random.multinomial()

numpy.random.multinomial(n, pvals, size=None) Draw samples from a multinomial distribution. The multinomial distribution is a multivariate generalisation of the binomial distribution. Take an experiment with one of p possible outcomes. An example of such an experiment is throwing a dice, where the outcome can be 1 through 6. Each sample drawn from the distribution represents n such experiments. Its values, X_i = [X_0, X_1, ..., X_p], represent the number of times the outcome was i. Paramete

recarray.ndim

recarray.ndim Number of array dimensions. Examples >>> x = np.array([1, 2, 3]) >>> x.ndim 1 >>> y = np.zeros((2, 3, 4)) >>> y.ndim 3

recarray.argpartition()

recarray.argpartition(kth, axis=-1, kind='introselect', order=None) Returns the indices that would partition this array. Refer to numpy.argpartition for full documentation. New in version 1.8.0. See also numpy.argpartition equivalent function

MaskedArray.flags

MaskedArray.flags Information about the memory layout of the array. Notes The flags object can be accessed dictionary-like (as in a.flags['WRITEABLE']), or by using lowercased attribute names (as in a.flags.writeable). Short flag names are only supported in dictionary access. Only the UPDATEIFCOPY, WRITEABLE, and ALIGNED flags can be changed by the user, via direct assignment to the attribute or dictionary entry, or by calling ndarray.setflags. The array flags cannot be set arbitrarily: UPD

chararray.size

chararray.size Number of elements in the array. Equivalent to np.prod(a.shape), i.e., the product of the array?s dimensions. Examples >>> x = np.zeros((3, 5, 2), dtype=np.complex128) >>> x.size 30 >>> np.prod(x.shape) 30

numpy.ma.sum()

numpy.ma.sum(self, axis=None, dtype=None, out=None) = Return the sum of the array elements over the given axis. Masked elements are set to 0 internally. Parameters: axis : {None, -1, int}, optional Axis along which the sum is computed. The default (axis = None) is to compute over the flattened array. dtype : {None, dtype}, optional Determines the type of the returned array and of the accumulator where the elements are summed. If dtype has the value None and the type of a is an integer

RandomState.poisson()

RandomState.poisson(lam=1.0, size=None) Draw samples from a Poisson distribution. The Poisson distribution is the limit of the binomial distribution for large N. Parameters: lam : float or sequence of float Expectation of interval, should be >= 0. A sequence of expectation intervals must be broadcastable over the requested size. size : int or tuple of ints, optional Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Default is None, in which case

MaskedArray.__nonzero__

MaskedArray.__nonzero__ x.__nonzero__() <==> x != 0