RandomState.standard_normal()

RandomState.standard_normal(size=None) Draw samples from a standard Normal distribution (mean=0, stdev=1). Parameters: 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 a single value is returned. Returns: out : float or ndarray Drawn samples. Examples >>> s = np.random.standard_normal(8000) >>> s array([ 0.6888893 , 0.78096262, -0.89086505, ..., 0.49876311,

numpy.polynomial.legendre.poly2leg()

numpy.polynomial.legendre.poly2leg(pol) [source] Convert a polynomial to a Legendre series. Convert an array representing the coefficients of a polynomial (relative to the ?standard? basis) ordered from lowest degree to highest, to an array of the coefficients of the equivalent Legendre series, ordered from lowest to highest degree. Parameters: pol : array_like 1-D array containing the polynomial coefficients Returns: c : ndarray 1-D array containing the coefficients of the equivalent

MaskedArray.soften_mask()

MaskedArray.soften_mask() [source] Force the mask to soft. Whether the mask of a masked array is hard or soft is determined by its hardmask property. soften_mask sets hardmask to False. See also hardmask

numpy.meshgrid()

numpy.meshgrid(*xi, **kwargs) [source] Return coordinate matrices from coordinate vectors. Make N-D coordinate arrays for vectorized evaluations of N-D scalar/vector fields over N-D grids, given one-dimensional coordinate arrays x1, x2,..., xn. Changed in version 1.9: 1-D and 0-D cases are allowed. Parameters: x1, x2,..., xn : array_like 1-D arrays representing the coordinates of a grid. indexing : {?xy?, ?ij?}, optional Cartesian (?xy?, default) or matrix (?ij?) indexing of output. S

numpy.copy()

numpy.copy(a, order='K') [source] Return an array copy of the given object. Parameters: a : array_like Input data. order : {?C?, ?F?, ?A?, ?K?}, optional Controls the memory layout of the copy. ?C? means C-order, ?F? means F-order, ?A? means ?F? if a is Fortran contiguous, ?C? otherwise. ?K? means match the layout of a as closely as possible. (Note that this function and :meth:ndarray.copy are very similar, but have different default values for their order= arguments.) Returns: arr :

generic.newbyteorder()

generic.newbyteorder(new_order='S') Return a new dtype with a different byte order. Changes are also made in all fields and sub-arrays of the data type. The new_order code can be any from the following: ?S? - swap dtype from current to opposite endian {?<?, ?L?} - little endian {?>?, ?B?} - big endian {?=?, ?N?} - native order {?|?, ?I?} - ignore (no change to byte order) Parameters: new_order : str, optional Byte order to force; a value from the byte order specifications above. The

ndarray.flatten()

ndarray.flatten(order='C') Return a copy of the array collapsed into one dimension. Parameters: order : {?C?, ?F?, ?A?, ?K?}, optional ?C? means to flatten in row-major (C-style) order. ?F? means to flatten in column-major (Fortran- style) order. ?A? means to flatten in column-major order if a is Fortran contiguous in memory, row-major order otherwise. ?K? means to flatten a in the order the elements occur in memory. The default is ?C?. Returns: y : ndarray A copy of the input array,

MaskedArray.fill()

MaskedArray.fill(value) Fill the array with a scalar value. Parameters: value : scalar All elements of a will be assigned this value. Examples >>> a = np.array([1, 2]) >>> a.fill(0) >>> a array([0, 0]) >>> a = np.empty(2) >>> a.fill(1) >>> a array([ 1., 1.])

numpy.diagonal()

numpy.diagonal(a, offset=0, axis1=0, axis2=1) [source] Return specified diagonals. If a is 2-D, returns the diagonal of a with the given offset, i.e., the collection of elements of the form a[i, i+offset]. If a has more than two dimensions, then the axes specified by axis1 and axis2 are used to determine the 2-D sub-array whose diagonal is returned. The shape of the resulting array can be determined by removing axis1 and axis2 and appending an index to the right equal to the size of the res

RandomState.shuffle()

RandomState.shuffle(x) Modify a sequence in-place by shuffling its contents. Parameters: x : array_like The array or list to be shuffled. Returns: None Examples >>> arr = np.arange(10) >>> np.random.shuffle(arr) >>> arr [1 7 5 2 9 4 3 6 0 8] This function only shuffles the array along the first index of a multi-dimensional array: >>> arr = np.arange(9).reshape((3, 3)) >>> np.random.shuffle(arr) >>> arr array([[3, 4, 5], [6,