Version 1.0b1 API Documentation generated by Endo 2006-08-14
Return the angle of the complex argument z.
Like asarray, but check that no NaNs or Infs are present.
average(a, axis=0, weights=None, returned=False)
Average the array over the given axis. If the axis is None, average
over all dimensions of the array. Equivalent to a.mean(axis), but
with a default axis of 0 instead of None.
If an integer axis is given, this equals:
a.sum(axis) * 1.0 / len(a)
If axis is None, this equals:
a.sum(axis) * 1.0 / product(a.shape)
If weights are given, result is:
sum(a * weights) / sum(weights),
where the weights must have a's shape or be 1D with length the
size of a in the given axis. Integer weights are converted to
Float. Not specifying weights is equivalent to specifying
weights that are all 1.
If 'returned' is True, return a tuple: the result and the sum of
the weights or count of values. The shape of these two results
will be the same.
Raises ZeroDivisionError if appropriate. (The version in MA does
not -- it returns masked values).
bartlett(M) returns the M-point Bartlett window.
blackman(M) returns the M-point Blackman window.
Return an array copy of the given object.
The correlation coefficients
Estimate the covariance matrix.
If m is a vector, return the variance. For matrices return the covariance matrix.
If y is given it is treated as an additional (set of) variable(s).
Normalization is by (N-1) where N is the number of observations (unbiased estimate). If bias is 1 then normalization is by N.
If rowvar is non-zero (default), then each row is a variable with observations in the columns, otherwise each column is a variable and the observations are in the rows.
Calculate the nth order discrete difference along given axis.
Display a message to the given device (default is sys.stdout) with or without a linefeed.
Return the elements of ravel(arr) where ravel(condition) is True (in 1D).
Equivalent to compress(ravel(condition), ravel(arr)).
Calculate the gradient of an N-dimensional scalar function.
Uses central differences on the interior and first differences on boundaries to give the same shape.
Inputs:
f -- An N-dimensional array giving samples of a scalar function
varargs -- 0, 1, or N scalars giving the sample distances in each direction
Outputs:
- N arrays of the same shape as f giving the derivative of f with respect
- to each dimension.
hamming(M) returns the M-point Hamming window.
hanning(M) returns the M-point Hanning window.
Similar to putmask arr[mask] = vals but the 1D array vals has the same number of elements as the non-zero values of mask. Inverse of extract.
kaiser(M, beta) returns a Kaiser window of length M with shape parameter beta. It depends on numpy.special (in full numpy) for the modified bessel function i0.
Return evenly spaced numbers.
Return 'num' evenly spaced samples from 'start' to 'stop'. If 'endpoint' is True, the last sample is 'stop'. If 'retstep' is True then return the step value used.
Evenly spaced numbers on a logarithmic scale.
Computes int(num) evenly spaced exponents from start to stop. If endpoint=True, then last exponent is stop. Returns base**exponents.
median(m) returns a median of m along the first dimension of m.
For vectors x, y with lengths Nx=len(x) and Ny=len(y), return X, Y where X and Y are (Ny, Nx) shaped arrays with the elements of x and y repeated to fill the matrix
EG,
[X, Y] = meshgrid([1,2,3], [4,5,6,7])
- X =
- 1 2 3 1 2 3 1 2 3 1 2 3
- Y =
- 4 4 4 5 5 5 6 6 6 7 7 7
Find the maximum over the given axis ignoring NaNs.
Find the indices of the minimium over the given axis ignoring NaNs.
Find the maximum over the given axis ignoring NaNs.
Find the minimium over the given axis, ignoring NaNs.
Sum the array over the given axis, treating NaNs as 0.
Return a piecewise-defined function.
x is the domain
condlist is a list of boolean arrays or a single boolean array
The length of the condition list must be n2 or n2-1 where n2
is the length of the function list. If len(condlist)==n2-1, then
an 'otherwise' condition is formed by |'ing all the conditions
and inverting.
funclist is a list of functions to call of length (n2).
Each function should return an array output for an array input
Each function can take (the same set) of extra arguments and
keyword arguments which are passed in after the function list.
A constant may be used in funclist for a function that returns a
constant (e.g. val and lambda x: val are equivalent in a funclist).
The output is the same shape and type as x and is found by
calling the functions on the appropriate portions of x.
Note: This is similar to choose or select, except
the the functions are only evaluated on elements of x
that satisfy the corresponding condition.
The result is
|--
| f1(x) for condition1
y = --| f2(x) for condition2
| ...
| fn(x) for conditionn
|--
Return an array composed of different elements of choicelist depending on the list of conditions.
condlist is a list of condition arrays containing ones or zeros
choicelist is a list of choice arrays (of the "same" size as the arrays in condlist). The result array has the "same" size as the arrays in choicelist. If condlist is [c0, ..., cN-1] then choicelist must be of length N. The elements of the choicelist can then be represented as [v0, ..., vN-1]. The default choice if none of the conditions are met is given as the default argument.
The conditions are tested in order and the first one statisfied is used to select the choice. In other words, the elements of the output array are found from the following tree (notice the order of the conditions matters):
if c0: v0 elif c1: v1 elif c2: v2 ... elif cN-1: vN-1 else: default
Note that one of the condition arrays must be large enough to handle the largest array in the choice list.
sinc(x) returns sin(pi*x)/(pi*x) at all points of array x.
Sort 'a' as a complex array using the real part first and then the imaginary part if the real part is equal (the default sort order for complex arrays). This function is a wrapper ensuring a complex return type.
Integrate y(x) using samples along the given axis and the composite trapezoidal rule. If x is None, spacing given by dx is assumed.
Trim the leading and trailing zeros from a 1D array.
>>> import numpy >>> a = array((0, 0, 0, 1, 2, 3, 2, 1, 0)) >>> numpy.trim_zeros(a) array([1, 2, 3, 2, 1])
Return unique items (in sorted order) from a 1-dimensional sequence.
Unwrap radian phase p by changing absolute jumps greater than 'discont' to their 2*pi complement along the given axis.
| Local name | Refers to |
|---|---|
| add | numpy.core.umath.add |
| add_docstring | _compiled_base.add_docstring |
| arange | numpy.core.numeric.arange |
| arctan2 | numpy.core.umath.arctan2 |
| array | multiarray.array |
| asanyarray | numpy.core.numeric.asanyarray |
| asarray | numpy.core.numeric.asarray |
| atleast_1d | numpy.lib.shape_base.atleast_1d |
| bincount | _compiled_base.bincount |
| choose | numpy.core.fromnumeric.choose |
| concatenate | numpy.core.numeric.concatenate |
| cos | numpy.core.umath.cos |
| diag | numpy.lib.twodim_base.diag |
| digitize | _compiled_base.digitize |
| dot | numpy.core.numeric.dot |
| empty | multiarray.empty |
| empty_like | numpy.core.numeric.empty_like |
| exp | numpy.core.umath.exp |
| frompyfunc | numpy.core.umath.frompyfunc |
| isnan | numpy.core.umath.isnan |
| less_equal | numpy.core.umath.less_equal |
| mod | numpy.core.umath.mod |
| multiply | numpy.core.umath.multiply |
| ndarray | multiarray.ndarray |
| newaxis | numpy.core.numeric.newaxis |
| nonzero | numpy.core.fromnumeric.nonzero |
| ones | numpy.core.numeric.ones |
| pi | numpy.core.umath.pi |
| ravel | numpy.core.fromnumeric.ravel |
| re | re |
| ScalarType | numpy.core.numerictypes.ScalarType |
| sin | numpy.core.umath.sin |
| sort | numpy.core.fromnumeric.sort |
| sqrt | numpy.core.umath.sqrt |
| typecodes | numpy.core.numerictypes.typecodes |
| types | types |
| where | numpy.core.numeric.where |
| zeros | numpy.core.numeric.zeros |
| _insert | _compiled_base._insert |
| _nx | numpy.core.numeric |