numpy.ma.masked_less_equal()

numpy.ma.masked_less_equal(x, value, copy=True) [source] Mask an array where less than or equal to a given value. This function is a shortcut to masked_where, with condition = (x <= value). See also masked_where Mask where a condition is met. Examples >>> import numpy.ma as ma >>> a = np.arange(4) >>> a array([0, 1, 2, 3]) >>> ma.masked_less_equal(a, 2) masked_array(data = [-- -- -- 3], mask = [ True True True False], fill_value=9999

numpy.isreal()

numpy.isreal(x) [source] Returns a bool array, where True if input element is real. If element has complex type with zero complex part, the return value for that element is True. Parameters: x : array_like Input array. Returns: out : ndarray, bool Boolean array of same shape as x. See also iscomplex isrealobj Return True if x is not a complex type. Examples >>> np.isreal([1+1j, 1+0j, 4.5, 3, 2, 2j]) array([False, True, True, True, True, False], dtype=bool)

Using the Convenience Classes

The convenience classes provided by the polynomial package are: Name Provides Polynomial Power series Chebyshev Chebyshev series Legendre Legendre series Laguerre Laguerre series Hermite Hermite series HermiteE HermiteE series The series in this context are finite sums of the corresponding polynomial basis functions multiplied by coefficients. For instance, a power series looks like and has coefficients . The Chebyshev series with the same coefficients looks like and more generally

MaskedArray.unshare_mask()

MaskedArray.unshare_mask() [source] Copy the mask and set the sharedmask flag to False. Whether the mask is shared between masked arrays can be seen from the sharedmask property. unshare_mask ensures the mask is not shared. A copy of the mask is only made if it was shared. See also sharedmask

recarray.byteswap()

recarray.byteswap(inplace) Swap the bytes of the array elements Toggle between low-endian and big-endian data representation by returning a byteswapped array, optionally swapped in-place. Parameters: inplace : bool, optional If True, swap bytes in-place, default is False. Returns: out : ndarray The byteswapped array. If inplace is True, this is a view to self. Examples >>> A = np.array([1, 256, 8755], dtype=np.int16) >>> map(hex, A) ['0x1', '0x100', '0x2233'] >&

numpy.random.standard_exponential()

numpy.random.standard_exponential(size=None) Draw samples from the standard exponential distribution. standard_exponential is identical to the exponential distribution with a scale parameter of 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 Output a 3x8000 array: >>> n

numpy.zeros()

numpy.zeros(shape, dtype=float, order='C') Return a new array of given shape and type, filled with zeros. Parameters: shape : int or sequence of ints Shape of the new array, e.g., (2, 3) or 2. dtype : data-type, optional The desired data-type for the array, e.g., numpy.int8. Default is numpy.float64. order : {?C?, ?F?}, optional Whether to store multidimensional data in C- or Fortran-contiguous (row- or column-wise) order in memory. Returns: out : ndarray Array of zeros with the g

Data type routines

can_cast(from, totype, casting = ) Returns True if cast between data types can occur according to the casting rule. promote_types(type1, type2) Returns the data type with the smallest size and smallest scalar kind to which both type1 and type2 may be safely cast. min_scalar_type(a) For scalar a, returns the data type with the smallest size and smallest scalar kind which can hold its value. result_type(*arrays_and_dtypes) Returns the type that results from applying the NumPy type promotion

numpy.seterrcall()

numpy.seterrcall(func) [source] Set the floating-point error callback function or log object. There are two ways to capture floating-point error messages. The first is to set the error-handler to ?call?, using seterr. Then, set the function to call using this function. The second is to set the error-handler to ?log?, using seterr. Floating-point errors then trigger a call to the ?write? method of the provided object. Parameters: func : callable f(err, flag) or object with write method Fun

recarray.cumprod()

recarray.cumprod(axis=None, dtype=None, out=None) Return the cumulative product of the elements along the given axis. Refer to numpy.cumprod for full documentation. See also numpy.cumprod equivalent function