Test Support (numpy.testing)

Common test support for all numpy test scripts. This single module should provide all the common functionality for numpy tests in a single location, so that test scripts can just import it and work right away. Asserts assert_almost_equal(actual, desired[, ...]) Raises an AssertionError if two items are not equal up to desired precision. assert_approx_equal(actual, desired[, ...]) Raises an AssertionError if two items are not equal up to significant digits. assert_array_almost_equal(x, y[,

numpy.right_shift()

numpy.right_shift(x1, x2[, out]) = Shift the bits of an integer to the right. Bits are shifted to the right x2. Because the internal representation of numbers is in binary format, this operation is equivalent to dividing x1 by 2**x2. Parameters: x1 : array_like, int Input values. x2 : array_like, int Number of bits to remove at the right of x1. Returns: out : ndarray, int Return x1 with bits shifted x2 times to the right. See also left_shift Shift the bits of an integer to th

numpy.ldexp()

numpy.ldexp(x1, x2[, out]) = Returns x1 * 2**x2, element-wise. The mantissas x1 and twos exponents x2 are used to construct floating point numbers x1 * 2**x2. Parameters: x1 : array_like Array of multipliers. x2 : array_like, int Array of twos exponents. out : ndarray, optional Output array for the result. Returns: y : ndarray or scalar The result of x1 * 2**x2. See also frexp Return (y1, y2) from x = y1 * 2**y2, inverse to ldexp. Notes Complex dtypes are not supported, th

numpy.random.multivariate_normal()

numpy.random.multivariate_normal(mean, cov[, size]) Draw random samples from a multivariate normal distribution. The multivariate normal, multinormal or Gaussian distribution is a generalization of the one-dimensional normal distribution to higher dimensions. Such a distribution is specified by its mean and covariance matrix. These parameters are analogous to the mean (average or ?center?) and variance (standard deviation, or ?width,? squared) of the one-dimensional normal distribution. Par

RandomState.hypergeometric()

RandomState.hypergeometric(ngood, nbad, nsample, size=None) Draw samples from a Hypergeometric distribution. Samples are drawn from a hypergeometric distribution with specified parameters, ngood (ways to make a good selection), nbad (ways to make a bad selection), and nsample = number of items sampled, which is less than or equal to the sum ngood + nbad. Parameters: ngood : int or array_like Number of ways to make a good selection. Must be nonnegative. nbad : int or array_like Number of

recarray.view()

recarray.view(dtype=None, type=None) New view of array with the same data. Parameters: dtype : data-type or ndarray sub-class, optional Data-type descriptor of the returned view, e.g., float32 or int16. The default, None, results in the view having the same data-type as a. This argument can also be specified as an ndarray sub-class, which then specifies the type of the returned object (this is equivalent to setting the type parameter). type : Python type, optional Type of the returned v

matrix.data

matrix.data Python buffer object pointing to the start of the array?s data.

ndarray.__eq__

ndarray.__eq__ x.__eq__(y) <==> x==y

chararray.ndim

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

generic.trace()

generic.trace() 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