numpy.core.defchararray.encode()

numpy.core.defchararray.encode(a, encoding=None, errors=None) [source] Calls str.encode element-wise. The set of available codecs comes from the Python standard library, and may be extended at runtime. For more information, see the codecs module. Parameters: a : array_like of str or unicode encoding : str, optional The name of an encoding errors : str, optional Specifies how to handle encoding errors Returns: out : ndarray See also str.encode Notes The type of the result will depe

numpy.polynomial.legendre.legroots()

numpy.polynomial.legendre.legroots(c) [source] Compute the roots of a Legendre series. Return the roots (a.k.a. ?zeros?) of the polynomial Parameters: c : 1-D array_like 1-D array of coefficients. Returns: out : ndarray Array of the roots of the series. If all the roots are real, then out is also real, otherwise it is complex. See also polyroots, chebroots, lagroots, hermroots, hermeroots Notes The root estimates are obtained as the eigenvalues of the companion matrix, Roots fa

numpy.allclose()

numpy.allclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False) [source] Returns True if two arrays are element-wise equal within a tolerance. The tolerance values are positive, typically very small numbers. The relative difference (rtol * abs(b)) and the absolute difference atol are added together to compare against the absolute difference between a and b. If either array contains one or more NaNs, False is returned. Infs are treated as equal if they are in the same place and of the same sig

numpy.log1p()

numpy.log1p(x[, out]) = Return the natural logarithm of one plus the input array, element-wise. Calculates log(1 + x). Parameters: x : array_like Input values. Returns: y : ndarray Natural logarithm of 1 + x, element-wise. See also expm1 exp(x) - 1, the inverse of log1p. Notes For real-valued input, log1p is accurate also for x so small that 1 + x == 1 in floating-point accuracy. Logarithm is a multivalued function: for each x there is an infinite number of z such that exp(z)

recarray.transpose()

recarray.transpose(*axes) Returns a view of the array with axes transposed. For a 1-D array, this has no effect. (To change between column and row vectors, first cast the 1-D array into a matrix object.) For a 2-D array, this is the usual matrix transpose. For an n-D array, if axes are given, their order indicates how the axes are permuted (see Examples). If axes are not provided and a.shape = (i[0], i[1], ... i[n-2], i[n-1]), then a.transpose().shape = (i[n-1], i[n-2], ... i[1], i[0]). Par

matrix.argpartition()

matrix.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.any()

MaskedArray.any(axis=None, out=None) [source] Check if any of the elements of a are true. Performs a logical_or over the given axis and returns the result. Masked values are considered as False during computation. Parameters: axis : {None, integer} Axis to perform the operation over. If None, perform over flattened array and return a scalar. out : {None, array}, optional Array into which the result can be placed. Its type is preserved and it must be of the right shape to hold the output

numpy.ma.flatnotmasked_edges()

numpy.ma.flatnotmasked_edges(a) [source] Find the indices of the first and last unmasked values. Expects a 1-D MaskedArray, returns None if all values are masked. Parameters: a : array_like Input 1-D MaskedArray Returns: edges : ndarray or None The indices of first and last non-masked value in the array. Returns None if all values are masked. See also flatnotmasked_contiguous, notmasked_contiguous, notmasked_edges, clump_masked, clump_unmasked Notes Only accepts 1-D arrays. Exampl

MaskedArray.shape

MaskedArray.shape Tuple of array dimensions. Notes May be used to ?reshape? the array, as long as this would not require a change in the total number of elements Examples >>> x = np.array([1, 2, 3, 4]) >>> x.shape (4,) >>> y = np.zeros((2, 3, 4)) >>> y.shape (2, 3, 4) >>> y.shape = (3, 8) >>> y array([[ 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0.]

RandomState.gumbel()

RandomState.gumbel(loc=0.0, scale=1.0, size=None) Draw samples from a Gumbel distribution. Draw samples from a Gumbel distribution with specified location and scale. For more information on the Gumbel distribution, see Notes and References below. Parameters: loc : float The location of the mode of the distribution. scale : float The scale parameter of the distribution. size : int or tuple of ints, optional Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples ar