| |
- corrcoef(x, y=None)
- cov(m, y=None, rowvar=0, bias=0)
- # This is exactly the same cov function as in MLab
- cumprod(x, axis=0)
- dump(...)
- dump(obj, file, protocol=0) -- Write an object in pickle format to the given file.
See the Pickler docstring for the meaning of optional argument proto.
- dumps(...)
- dumps(obj, protocol=0) -- Return a string containing an object in pickle format.
See the Pickler docstring for the meaning of optional argument proto.
- eye(N, M=None, k=0, typecode=None, dtype=None)
- eye returns a N-by-M 2-d array where the k-th diagonal is all ones,
and everything else is zeros.
- innerproduct = inner(...)
- inner(a, b)
Inner product of two arrays.
Ordinary inner product of vectors for 1-D arrays (without complex
conjugation), in higher dimensions a sum product over the last axes.
Parameters
----------
a, b : array_like
If `a` and `b` are nonscalar, their last dimensions of must match.
Returns
-------
out : ndarray
`out.shape = a.shape[:-1] + b.shape[:-1]`
Raises
------
ValueError
If the last dimension of `a` and `b` has different size.
See Also
--------
tensordot : Sum products over arbitrary axes.
dot : Generalised matrix product, using second last dimension of `b`.
Notes
-----
For vectors (1-D arrays) it computes the ordinary inner-product::
np.inner(a, b) = sum(a[:]*b[:])
More generally, if `ndim(a) = r > 0` and `ndim(b) = s > 0`::
np.inner(a, b) = np.tensordot(a, b, axes=(-1,-1))
or explicitly::
np.inner(a, b)[i0,...,ir-1,j0,...,js-1]
= sum(a[i0,...,ir-1,:]*b[j0,...,js-1,:])
In addition `a` or `b` may be scalars, in which case::
np.inner(a,b) = a*b
Examples
--------
Ordinary inner product for vectors:
>>> a = np.array([1,2,3])
>>> b = np.array([0,1,0])
>>> np.inner(a, b)
2
A multidimensional example:
>>> a = np.arange(24).reshape((2,3,4))
>>> b = np.arange(4)
>>> np.inner(a, b)
array([[ 14, 38, 62],
[ 86, 110, 134]])
An example where `b` is a scalar:
>>> np.inner(np.eye(2), 7)
array([[ 7., 0.],
[ 0., 7.]])
- max(x, axis=0)
- mean(x, axis=0)
- min(x, axis=0)
- prod(x, axis=0)
- ptp(x, axis=0)
- rand(...)
- rand(d0, d1, ..., dn)
Random values in a given shape.
Create an array of the given shape and propagate it with
random samples from a uniform distribution
over ``[0, 1)``.
Parameters
----------
d0, d1, ..., dn : int
Shape of the output.
Returns
-------
out : ndarray, shape ``(d0, d1, ..., dn)``
Random values.
See Also
--------
random
Notes
-----
This is a convenience function. If you want an interface that
takes a shape-tuple as the first argument, refer to
`random`.
Examples
--------
>>> np.random.rand(3,2)
array([[ 0.14022471, 0.96360618], #random
[ 0.37601032, 0.25528411], #random
[ 0.49313049, 0.94909878]]) #random
- randn(...)
- randn(d0, d1, ..., dn)
Returns zero-mean, unit-variance Gaussian random numbers in an
array of shape (d0, d1, ..., dn).
Note: This is a convenience function. If you want an
interface that takes a tuple as the first argument
use numpy.random.standard_normal(shape_tuple).
- std(x, axis=0)
- trapz(y, x=None, axis=-1)
- tri(N, M=None, k=0, typecode=None, dtype=None)
- returns a N-by-M array where all the diagonals starting from
lower left corner up to the k-th are all ones.
|