Mathematical functions with automatic domain (numpy.emath)

Note numpy.emath is a preferred alias for numpy.lib.scimath, available after numpy is imported. Wrapper functions to more user-friendly calling of certain math functions whose output data-type is different than the input data-type in certain domains of the input. For example, for functions like log with branch cuts, the versions in this module provide the mathematically valid answers in the complex plane: >>> import math >>> from numpy.lib import scimath >>> scimat

matrix.getA()

matrix.getA() [source] Return self as an ndarray object. Equivalent to np.asarray(self). Parameters: None Returns: ret : ndarray self as an ndarray Examples >>> x = np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> x.getA() array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]])

MaskedArray.strides

MaskedArray.strides Tuple of bytes to step in each dimension when traversing an array. The byte offset of element (i[0], i[1], ..., i[n]) in an array a is: offset = sum(np.array(i) * a.strides) A more detailed explanation of strides can be found in the ?ndarray.rst? file in the NumPy reference guide. See also numpy.lib.stride_tricks.as_strided Notes Imagine an array of 32-bit integers (each 4 bytes): x = np.array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]], dtype=np.int32) This arr

MaskedArray.product()

MaskedArray.product(axis=None, dtype=None, out=None) [source] Return the product of the array elements over the given axis. Masked elements are set to 1 internally for computation. Parameters: axis : {None, int}, optional Axis over which the product is taken. If None is used, then the product is over all the array elements. dtype : {None, dtype}, optional Determines the type of the returned array and of the accumulator where the elements are multiplied. If dtype has the value None and t

numpy.testing.decorators.knownfailureif()

numpy.testing.decorators.knownfailureif(fail_condition, msg=None) [source] Make function raise KnownFailureException exception if given condition is true. If the condition is a callable, it is used at runtime to dynamically make the decision. This is useful for tests that may require costly imports, to delay the cost until the test suite is actually executed. Parameters: fail_condition : bool or callable Flag to determine whether to mark the decorated test as a known failure (if True) or

ndarray.__array__()

ndarray.__array__(|dtype) ? reference if type unchanged, copy otherwise. Returns either a new reference to self if dtype is not given or a new array of provided data type if dtype is different from the current dtype of the array.

MaskedArray.compress()

MaskedArray.compress(condition, axis=None, out=None) [source] Return a where condition is True. If condition is a MaskedArray, missing values are considered as False. Parameters: condition : var Boolean 1-d array selecting which entries to return. If len(condition) is less than the size of a along the axis, then output is truncated to length of condition array. axis : {None, int}, optional Axis along which the operation must be performed. out : {None, ndarray}, optional Alternative ou

MaskedArray.ids()

MaskedArray.ids() [source] Return the addresses of the data and mask areas. Parameters: None Examples >>> x = np.ma.array([1, 2, 3], mask=[0, 1, 1]) >>> x.ids() (166670640, 166659832) If the array has no mask, the address of nomask is returned. This address is typically not close to the data in memory: >>> x = np.ma.array([1, 2, 3]) >>> x.ids() (166691080, 3083169284L)

numpy.polynomial.laguerre.poly2lag()

numpy.polynomial.laguerre.poly2lag(pol) [source] Convert a polynomial to a Laguerre 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 Laguerre 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

Polynomial Package

New in version 1.4.0. Using the Convenience ClassesBasics Calculus Other Polynomial Constructors Fitting Polynomial Module (numpy.polynomial.polynomial)Polynomial Class Basics Fitting Calculus Algebra Miscellaneous Chebyshev Module (numpy.polynomial.chebyshev)Chebyshev Class Basics Fitting Calculus Algebra Quadrature Miscellaneous Legendre Module (numpy.polynomial.legendre)Legendre Class Basics Fitting Calculus Algebra Quadrature Miscellaneous Laguerre Module (numpy.polynomial.lagu