numpy.numarray.mlab (version 1.3.0)
index
/usr/lib/python2.6/dist-packages/numpy/numarray/mlab.py

 
Modules
       
numpy.oldnumeric.linear_algebra
numpy.oldnumeric.random_array
StringIO
copy
copy_reg
math
numpy.core.multiarray
pickle
string
types

 
Functions
       
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.
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.]])
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).

 
Data
        Character = 'c'
Complex = 'D'
Complex0 = 'F'
Complex16 = 'F'
Complex32 = 'F'
Complex64 = 'D'
Complex8 = 'F'
Float = 'd'
Float0 = 'f'
Float16 = 'f'
Float32 = 'f'
Float64 = 'd'
Float8 = 'f'
Int = 'l'
Int0 = 'b'
Int16 = 'h'
Int32 = 'i'
Int64 = 'l'
Int8 = 'b'
LittleEndian = True
NewAxis = None
PyObject = 'O'
UInt = 'u'
UInt16 = 'H'
UInt32 = 'I'
UInt64 = 'L'
UInt8 = 'B'
UnsignedInt = 'u'
UnsignedInt16 = 'H'
UnsignedInt32 = 'I'
UnsignedInt64 = 'L'
UnsignedInt8 = 'B'
UnsignedInteger = 'u'
__all__ = ['rand', 'tril', 'trapz', 'hanning', 'rot90', 'triu', 'diff', 'angle', 'roots', 'ptp', 'kaiser', 'randn', 'cumprod', 'diag', 'msort', 'LinearAlgebra', 'RandomArray', 'prod', 'std', 'hamming', ...]
__file__ = '/usr/lib/python2.6/dist-packages/numpy/numarray/mlab.pyc'
__name__ = 'numpy.numarray.mlab'
__package__ = 'numpy.numarray'
divide_safe = <ufunc 'divide'>
typecodes = {'Character': 'c', 'Complex': 'FD', 'Float': 'fd', 'Integer': 'bhil', 'UnsignedInteger': 'BHIL'}