- add_newdoc(place, obj, doc)
- angle(z, deg = 0)
Return the angle of the complex argument z.
- asarray_chkfinite(a)
Like asarray, but check that no NaNs or Infs are present.
- average(a, axis = 0, weights = None, returned = False)
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)
bartlett(M) returns the M-point Bartlett window.
- blackman(M)
blackman(M) returns the M-point Blackman window.
- copy(a)
Return an array copy of the given object.
- corrcoef(x, y = None)
The correlation coefficients
- cov(m, y = None, rowvar = 0, bias = 0)
Estimate the covariance matrix.
If m is a vector, return the variance. For matrices where each row
is an observation, and each column a variable, return the covariance
matrix. Note that in this case diag(cov(m)) is a vector of
variances for each column.
cov(m) is the same as cov(m, m)
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 zero, then each row is a variable with
observations in the columns.
- diff(a, n = 1, axis = -Const(1))
Calculate the nth order discrete difference along given axis.
- disp(mesg, device = None, linefeed = True)
Display a message to the given device (default is sys.stdout)
with or without a linefeed.
- gradient(f, varargs)
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)
hamming(M) returns the M-point Hamming window.
- hanning(M)
hanning(M) returns the M-point Hanning window.
- histogram(a, bins = 10, range = None, normed = False)
- i0(x)
- insert(arr, mask, vals)
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.
- iterable(y)
- kaiser(M, beta)
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.
- linspace(start, stop, num = 50, endpoint = True, retstep = False)
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.
- logspace(start, stop, num = 50, endpoint = True, base = 10.0)
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)
median(m) returns a median of m along the first dimension of m.
- msort(a)
- nanargmax(a, axis = -Const(1))
Find the maximum over the given axis ignoring NaNs.
- nanargmin(a, axis = -Const(1))
Find the indices of the minimium over the given axis ignoring NaNs.
- nanmax(a, axis = -Const(1))
Find the maximum over the given axis ignoring NaNs.
- nanmin(a, axis = -Const(1))
Find the minimium over the given axis, ignoring NaNs.
- nansum(a, axis = -Const(1))
Sum the array over the given axis, treating NaNs as 0.
- piecewise(x, condlist, funclist, args, kw)
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
|--
- select(condlist, choicelist, default = 0)
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)
sinc(x) returns sin(pi*x)/(pi*x) at all points of array x.
- sort_complex(a)
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.
- trapz(y, x = None, dx = 1.0, axis = -Const(1))
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_zeros(filt, trim = 'fb')
Trim the leading and trailing zeros from a 1D array.
Example:
>>> import numpy
>>> a = array((0, 0, 0, 1, 2, 3, 2, 1, 0))
>>> numpy.trim_zeros(a)
array([1, 2, 3, 2, 1])
- unique(inseq)
Return unique items from a 1-dimensional sequence.
- unwrap(p, discont = pi, axis = -Const(1))
Unwrap radian phase p by changing absolute jumps greater than
'discont' to their 2*pi complement along the given axis.