nums.numpy

Functions in the nums.numpy module.

NumS Supported API

loadtxt(fname[, dtype, comments, delimiter, …])

Load data from a text file.

array(object[, dtype, copy, order, ndmin, subok])

Creates a BlockArray.

empty(shape[, dtype])

Return a new array of given shape and type, without initializing entries.

zeros_like(prototype[, dtype, order, shape])

Return an array of zeros with the same shape and type as a given array.

ones_like(prototype[, dtype, order, shape])

Return an array of ones with the same shape and type as a given array.

concatenate(arrays[, axis, out])

Join a sequence of arrays along an existing axis.

split(ary, indices_or_sections[, axis])

Split an array into multiple sub-arrays as views into ary.

identity(n[, dtype])

Return the identity array.

eye(N[, M, k, dtype])

Return a 2-D array with ones on the diagonal and zeros elsewhere.

diag(v[, k])

Extract a diagonal or construct a diagonal array.

trace(a[, offset, axis1, axis2, dtype, out])

Return the sum along diagonals of the array.

atleast_1d(*arys)

Convert inputs to arrays with at least one dimension.

atleast_2d(*arys)

View inputs as arrays with at least two dimensions.

atleast_3d(*arys)

View inputs as arrays with at least three dimensions.

hstack(tup)

Stack arrays in sequence horizontally (column wise).

vstack(tup)

Stack arrays in sequence vertically (row wise).

dstack(tup)

Stack arrays in sequence depth wise (along third axis).

row_stack(tup)

Stack arrays in sequence vertically (row wise).

column_stack(tup)

Stack 1-D arrays as columns into a 2-D array.

arange([start, stop, step, dtype])

Return evenly spaced values within a given interval.

linspace(start, stop[, num, endpoint, …])

Return evenly spaced numbers over a specified interval.

logspace(start, stop[, num, endpoint, base, …])

Return numbers spaced evenly on a log scale.

tensordot(x1, x2[, axes])

Compute tensor dot product along specified axes.

matmul(x1, x2)

Matrix product of two arrays.

inner(a, b)

Inner product of two arrays.

outer(a, b)

Compute the outer product of two vectors.

dot(a, b[, out])

Dot product of two arrays.

shape(a)

Return the shape of an array.

size(a)

Return the number of elements along a given axis.

ndim(a)

Return the number of dimensions of an array.

reshape(a, shape)

Gives a new shape to an array without changing its data.

expand_dims(a, axis)

Expand the shape of an array.

squeeze(a[, axis])

Remove single-dimensional entries from the shape of an array.

swapaxes(a, axis1, axis2)

Interchange two axes of an array.

transpose(a[, axes])

Reverse or permute the axes of an array; returns the modified array.

copy(a[, order, subok])

Return an array copy of the given object.

min(a[, axis, out, keepdims, initial, where])

Return the minimum of an array or minimum along an axis.

max(a[, axis, out, keepdims, initial, where])

Return the maximum of an array or maximum along an axis.

argmin(a[, axis, out])

Returns the indices of the minimum values along an axis.

argmax(a[, axis, out])

Returns the indices of the maximum values along an axis.

sum(a[, axis, dtype, out, keepdims, …])

Sum of array elements over a given axis.

mean(a[, axis, dtype, out, keepdims])

Compute the arithmetic mean along the specified axis.

var(a[, axis, dtype, out, ddof, keepdims])

Compute the variance along the specified axis.

std(a[, axis, dtype, out, ddof, keepdims])

Compute the standard deviation along the specified axis.

where(condition[, x, y])

Return elements chosen from x or y depending on condition.

all(a[, axis, out, keepdims])

Test whether all array elements along a given axis evaluate to True.

alltrue(a[, axis, out, dtype, keepdims])

Check if all elements of input array are true.

any(a[, axis, out, keepdims])

Test whether any array element along a given axis evaluates to True.

average(a[, axis, weights, returned])

Compute the weighted average along the specified axis.

median(a[, axis, out, keepdims])

Compute the median along the specified axis.

nanmax(a[, axis, out, keepdims])

Return the maximum of an array or maximum along an axis, ignoring any NaNs.

nanmin(a[, axis, out, keepdims])

Return minimum of an array or minimum along an axis, ignoring any NaNs.

nansum(a[, axis, dtype, out, keepdims])

Return the sum of array elements over a given axis treating Not a Numbers (NaNs) as zero.

nanmean(a[, axis, dtype, out, keepdims])

Compute the arithmetic mean along the specified axis, ignoring NaNs.

nanvar(a[, axis, dtype, out, ddof, keepdims])

Compute the variance along the specified axis, while ignoring NaNs.

nanstd(a[, axis, dtype, out, ddof, keepdims])

Compute the standard deviation along the specified axis, while ignoring NaNs.

array_equal(a, b[, equal_nan])

True if two arrays have the same shape and elements, False otherwise.

array_equiv(a, b)

Returns True if input arrays are shape consistent and all elements equal.

allclose(a, b[, rtol, atol, equal_nan])

Returns True if two arrays are element-wise equal within a tolerance.

abs(x[, out, where])

Calculate the absolute value element-wise.

absolute(x[, out, where])

Calculate the absolute value element-wise.

arccos(x[, out, where])

Trigonometric inverse cosine, element-wise.

arccosh(x[, out, where])

Inverse hyperbolic cosine, element-wise.

arcsin(x[, out, where])

Inverse sine, element-wise.

arcsinh(x[, out, where])

Inverse hyperbolic sine element-wise.

arctan(x[, out, where])

Trigonometric inverse tangent, element-wise.

arctanh(x[, out, where])

Inverse hyperbolic tangent element-wise.

bitwise_not(x[, out, where])

Compute bit-wise inversion, or bit-wise NOT, element-wise.

cbrt(x[, out, where])

Return the cube-root of an array, element-wise.

ceil(x[, out, where])

Return the ceiling of the input, element-wise.

conj(x[, out, where])

Return the complex conjugate, element-wise.

conjugate(x[, out, where])

Return the complex conjugate, element-wise.

cos(x[, out, where])

Cosine element-wise.

cosh(x[, out, where])

Hyperbolic cosine, element-wise.

deg2rad(x[, out, where])

Convert angles from degrees to radians.

degrees(x[, out, where])

Convert angles from radians to degrees.

exp(x[, out, where])

Calculate the exponential of all elements in the input array.

exp2(x[, out, where])

Calculate 2**p for all p in the input array.

expm1(x[, out, where])

Calculate exp(x) - 1 for all elements in the array.

fabs(x[, out, where])

Compute the absolute values element-wise.

floor(x[, out, where])

Return the floor of the input, element-wise.

invert(x[, out, where])

Compute bit-wise inversion, or bit-wise NOT, element-wise.

isfinite(x[, out, where])

Test element-wise for finiteness (not infinity or not Not a Number).

isinf(x[, out, where])

Test element-wise for positive or negative infinity.

isnan(x[, out, where])

Test element-wise for NaN and return result as a boolean array.

log(x[, out, where])

Natural logarithm, element-wise.

log10(x[, out, where])

Return the base 10 logarithm of the input array, element-wise.

log1p(x[, out, where])

Return the natural logarithm of one plus the input array, element-wise.

log2(x[, out, where])

Base-2 logarithm of x.

logical_not(x[, out, where])

Compute the truth value of NOT x element-wise.

negative(x[, out, where])

Numerical negative, element-wise.

positive(x[, out, where])

Numerical positive, element-wise.

radians(x[, out, where])

Convert angles from degrees to radians.

reciprocal(x[, out, where])

Return the reciprocal of the argument, element-wise.

rint(x[, out, where])

Round elements of the array to the nearest integer.

sign(x[, out, where])

Returns an element-wise indication of the sign of a number.

signbit(x[, out, where])

Returns element-wise True where signbit is set (less than zero).

sin(x[, out, where])

Trigonometric sine, element-wise.

sinh(x[, out, where])

Hyperbolic sine, element-wise.

spacing(x[, out, where])

Return the distance between x and the nearest adjacent number.

sqrt(x[, out, where])

Return the non-negative square-root of an array, element-wise.

square(x[, out, where])

Return the element-wise square of the input.

tan(x[, out, where])

Compute tangent element-wise.

tanh(x[, out, where])

Compute hyperbolic tangent element-wise.

trunc(x[, out, where])

Return the truncated value of the input, element-wise.

add(x1, x2[, out, where])

Add arguments element-wise.

arctan2(x1, x2[, out, where])

Element-wise arc tangent of x1/x2 choosing the quadrant correctly.

bitwise_and(x1, x2[, out, where])

Compute the bit-wise AND of two arrays element-wise.

bitwise_or(x1, x2[, out, where])

Compute the bit-wise OR of two arrays element-wise.

bitwise_xor(x1, x2[, out, where])

Compute the bit-wise XOR of two arrays element-wise.

copysign(x1, x2[, out, where])

Change the sign of x1 to that of x2, element-wise.

divide(x1, x2[, out, where])

Returns a true division of the inputs, element-wise.

equal(x1, x2[, out, where])

Return (x1 == x2) element-wise.

float_power(x1, x2[, out, where])

First array elements raised to powers from second array, element-wise.

floor_divide(x1, x2[, out, where])

Return the largest integer smaller or equal to the division of the inputs.

fmax(x1, x2[, out, where])

Element-wise maximum of array elements.

fmin(x1, x2[, out, where])

Element-wise minimum of array elements.

fmod(x1, x2[, out, where])

Return the element-wise remainder of division.

greater(x1, x2[, out, where])

Return the truth value of (x1 > x2) element-wise.

greater_equal(x1, x2[, out, where])

Return the truth value of (x1 >= x2) element-wise.

heaviside(x1, x2[, out, where])

Compute the Heaviside step function.

hypot(x1, x2[, out, where])

Given the “legs” of a right triangle, return its hypotenuse.

lcm(x1, x2[, out, where])

This docstring was copied from numpy.lcm.

ldexp(x1, x2[, out, where])

Returns x1 * 2**x2, element-wise.

left_shift(x1, x2[, out, where])

Shift the bits of an integer to the left.

less(x1, x2[, out, where])

Return the truth value of (x1 < x2) element-wise.

less_equal(x1, x2[, out, where])

Return the truth value of (x1 =< x2) element-wise.

logaddexp(x1, x2[, out, where])

Logarithm of the sum of exponentiations of the inputs.

logaddexp2(x1, x2[, out, where])

Logarithm of the sum of exponentiations of the inputs in base-2.

logical_and(x1, x2[, out, where])

Compute the truth value of x1 AND x2 element-wise.

logical_or(x1, x2[, out, where])

Compute the truth value of x1 OR x2 element-wise.

logical_xor(x1, x2[, out, where])

Compute the truth value of x1 XOR x2, element-wise.

maximum(x1, x2[, out, where])

Element-wise maximum of array elements.

minimum(x1, x2[, out, where])

Element-wise minimum of array elements.

mod(x1, x2[, out, where])

Return element-wise remainder of division.

multiply(x1, x2[, out, where])

Multiply arguments element-wise.

nextafter(x1, x2[, out, where])

Return the next floating-point value after x1 towards x2, element-wise.

not_equal(x1, x2[, out, where])

This docstring was copied from numpy.not_equal.

power(x1, x2[, out, where])

First array elements raised to powers from second array, element-wise.

remainder(x1, x2[, out, where])

Return element-wise remainder of division.

right_shift(x1, x2[, out, where])

Shift the bits of an integer to the right.

subtract(x1, x2[, out, where])

Subtract arguments, element-wise.

true_divide(x1, x2[, out, where])

Returns a true division of the inputs, element-wise.

diag(v[, k])

Extract a diagonal or construct a diagonal array.

ones(shape[, dtype])

Return a new array of given shape and type, filled with ones.

empty_like(prototype[, dtype, order, shape])

Return a new array with the same shape and type as a given array.

trace(a[, offset, axis1, axis2, dtype, out])

Return the sum along diagonals of the array.

top_k(a, k[, largest, sorted])

Find the k largest or smallest elements of a BlockArray.