numpy.numarray.__init__
index
/usr/lib/python2.6/dist-packages/numpy/numarray/__init__.py

 
Modules
       
copy
copy_reg
math
numpy.numarray.numerictypes
operator
os
numpy.numarray.session
sys
types

 
Functions
       
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.]])
matrixmultiply = dot(...)
dot(a, b)
 
Dot product of two arrays.
 
For 2-D arrays it is equivalent to matrix multiplication, and for 1-D
arrays to inner product of vectors (without complex conjugation). For
N dimensions it is a sum product over the last axis of `a` and
the second-to-last of `b`::
 
    dot(a, b)[i,j,k,m] = sum(a[i,j,:] * b[k,:,m])
 
Parameters
----------
a : array_like
    First argument.
b : array_like
    Second argument.
 
Returns
-------
output : ndarray
    Returns the dot product of `a` and `b`.  If `a` and `b` are both
    scalars or both 1-D arrays then a scalar is returned; otherwise
    an array is returned.
 
Raises
------
ValueError
    If the last dimension of `a` is not the same size as
    the second-to-last dimension of `b`.
 
See Also
--------
vdot : Complex-conjugating dot product.
tensordot : Sum products over arbitrary axes.
 
Examples
--------
>>> np.dot(3, 4)
12
 
Neither argument is complex-conjugated:
 
>>> np.dot([2j, 3j], [2j, 3j])
(-13+0j)
 
For 2-D arrays it's the matrix product:
 
>>> a = [[1, 0], [0, 1]]
>>> b = [[4, 1], [2, 2]]
>>> np.dot(a, b)
array([[4, 1],
       [2, 2]])
 
>>> a = np.arange(3*4*5*6).reshape((3,4,5,6))
>>> b = np.arange(3*4*5*6)[::-1].reshape((5,4,6,3))
>>> np.dot(a, b)[2,3,2,1,2,2]
499128
>>> sum(a[2,3,2,:] * b[1,2,:,2])
499128

 
Data
        Any = <numpy.numarray.numerictypes.AnyType object at 0x4f81b90>
Bool = <numpy.numarray.numerictypes.BooleanType object at 0x4f81c10>
Byte = <numpy.numarray.numerictypes.SignedIntegralType object at 0x4f81c50>
Complex = <numpy.numarray.numerictypes.ComplexType object at 0x4f81f10>
Complex32 = <numpy.numarray.numerictypes.ComplexType object at 0x4f81ed0>
Complex64 = <numpy.numarray.numerictypes.ComplexType object at 0x4f81f10>
Float = <numpy.numarray.numerictypes.FloatingType object at 0x4f81d90>
Float32 = <numpy.numarray.numerictypes.FloatingType object at 0x4f81d50>
Float64 = <numpy.numarray.numerictypes.FloatingType object at 0x4f81d90>
HasUInt64 = 1
Int = <numpy.numarray.numerictypes.SignedIntegralType object at 0x4f81cd0>
Int16 = <numpy.numarray.numerictypes.SignedIntegralType object at 0x4f81c90>
Int32 = <numpy.numarray.numerictypes.SignedIntegralType object at 0x4f81cd0>
Int64 = <numpy.numarray.numerictypes.SignedIntegralType object at 0x4f81d10>
Int8 = <numpy.numarray.numerictypes.SignedIntegralType object at 0x4f81c50>
Long = <numpy.numarray.numerictypes.SignedIntegralType object at 0x4f81d10>
MaybeLong = <numpy.numarray.numerictypes.SignedIntegralType object at 0x4f81d10>
NewAxis = None
Object = <numpy.numarray.numerictypes.ObjectType object at 0x4f81bd0>
SLOPPY = 1
STRICT = 0
Short = <numpy.numarray.numerictypes.SignedIntegralType object at 0x4f81c90>
UInt16 = <numpy.numarray.numerictypes.UnsignedIntegralType object at 0x4f81e10>
UInt32 = <numpy.numarray.numerictypes.UnsignedIntegralType object at 0x4f81e50>
UInt64 = <numpy.numarray.numerictypes.UnsignedIntegralType object at 0x4f81e90>
UInt8 = <numpy.numarray.numerictypes.UnsignedIntegralType object at 0x4f81dd0>
WARN = 2
__all__ = ['session', 'numerictypes', 'MathDomainError', 'UnderflowError', 'NumOverflowError', 'handleError', 'get_numarray_include_dirs', 'NumericType', 'HasUInt64', 'typeDict', 'IsType', 'BooleanType', 'SignedType', 'UnsignedType', 'IntegralType', 'SignedIntegralType', 'UnsignedIntegralType', 'FloatingType', 'ComplexType', 'AnyType', ...]
__file__ = '/usr/lib/python2.6/dist-packages/numpy/numarray/__init__.pyc'
__name__ = 'numpy.numarray.__init__'
__package__ = 'numpy.numarray'
genericCoercions = {('Bool', 'Bool'): 'Bool', ('Bool', 'Complex32'): 'Complex32', ('Bool', 'Complex64'): 'Complex64', ('Bool', 'Float32'): 'Float32', ('Bool', 'Float64'): 'Float64', ('Bool', 'Int16'): 'Int16', ('Bool', 'Int32'): 'Int32', ('Bool', 'Int64'): 'Int64', ('Bool', 'Int8'): 'Int8', ('Bool', 'Object'): 'Object', ...}
genericPromotionExclusions = {'Bool': (), 'Complex32': (), 'Complex64': (), 'Float32': (), 'Float64': ('Complex32',), 'Int16': (), 'Int32': ('Float32', 'Complex32'), 'Int64': ('Float32', 'Complex32'), 'Int8': (), 'UInt16': (), ...}
genericTypeRank = ['Bool', 'Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32', 'Int64', 'UInt64', 'Float32', 'Float64', 'Complex32', 'Complex64', 'Object']
isBigEndian = False
lshift = <ufunc 'left_shift'>
minus = <ufunc 'negative'>
pythonTypeMap = {<type 'float'>: ('Float64', 'float'), <type 'int'>: ('Int64', 'int'), <type 'long'>: ('Int64', 'int'), <type 'bool'>: ('Bool', 'bool'), <type 'complex'>: ('Complex64', 'complex')}
pythonTypeRank = [<type 'bool'>, <type 'int'>, <type 'long'>, <type 'float'>, <type 'complex'>]
rshift = <ufunc 'right_shift'>
scalarTypeMap = {<type 'float'>: 'Float64', <type 'int'>: 'Int64', <type 'long'>: 'Int64', <type 'bool'>: 'Bool', <type 'complex'>: 'Complex64'}
scalarTypes = (<type 'bool'>, <type 'int'>, <type 'long'>, <type 'float'>, <type 'complex'>)
tcode = 'f'
tname = 'Float32'
typeDict = {'1': <numpy.numarray.numerictypes.SignedIntegralType object at 0x4f81c50>, 'Any': <numpy.numarray.numerictypes.AnyType object at 0x4f81b90>, 'B': <numpy.numarray.numerictypes.BooleanType object at 0x4f81c10>, 'Bool': <numpy.numarray.numerictypes.BooleanType object at 0x4f81c10>, 'Byte': <numpy.numarray.numerictypes.SignedIntegralType object at 0x4f81c50>, 'Complex': <numpy.numarray.numerictypes.ComplexType object at 0x4f81f10>, 'Complex32': <numpy.numarray.numerictypes.ComplexType object at 0x4f81ed0>, 'Complex64': <numpy.numarray.numerictypes.ComplexType object at 0x4f81f10>, 'D': <numpy.numarray.numerictypes.ComplexType object at 0x4f81f10>, 'F': <numpy.numarray.numerictypes.ComplexType object at 0x4f81ed0>, ...}
typecodes = {'Character': 'c', 'Complex': 'FD', 'Float': 'fd', 'Integer': '1silN', 'UnsignedInteger': 'bBwuU'}
value = 'f'