numpy函数解析

numpy.memmap

class numpy.memmap

create a memory-map to an array stored in a binary file on disk.

Memory-mapped files are used for accessing small segments of large files on disk, without reading the entire file into memory. Numpy's memmap's are array-like objects. This differs from Python's mmap module, which uses file-like objects.

numpy.diff

numpy.diff(a, n=1,axis=-1)

Calculate the n-th order discrete difference along given axis.

The first order difference is given by out[n]=a[n+1]-a[n] along the given axis, higher order differences are calculated by using diff recursively.

numpy.arange

numpy.arange([start,]stop,[step,]dtype=none)

Return evenly spaced values within a given interval.

numpy.reshape

numpy.reshape(a, newshape, order='C')

newshape: int or tuple or ints

The new shape should be compatible with the original shape. If an integer, then the result will be a 1-D array of that length. One shape dimension can be -1. In  this case, the value is inferred from the length of the array and remaining dimensions.

numpy.mean
numpy.mean(a, axis=None, dtype=None, out=None, keepdims=False)
Compute the arithmetic mean along the specified axis.
Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis. float64intermediate and return values are used for integer inputs.

numpy.sqrt
numpy.sqrt(x[, out])
Return the positive square-root of an array, element-wise.
>>> np.sqrt([1,4,9])
array([ 1., 2., 3.])
numpy.vectorize
numpy.vectorize(pyfunc, otypes='')
Generalized function class.
Define a vectorized function which takes a nested sequence of objects or numpy arrays inputs and returns a numpy array as output. The vectorized function evaluates pyfunc over successive tuples of the input arrays like the python map function, except it uses the broadcasting rules of numpy.
The data type of the output of vectorized is determined by calling the function with the first element of the input. The can be avoided by specifying the otypes argument.

numpy.array

numpy.array(object, dtype=None, copy=True, order=None, subok=False, ndmin=0)
Create an array.
object: array_like
An array, any object exposing the array interface, an object whose __array__ method returns an array, or any (nested) sequence.
dtype: data-type, optional
The desired data-type for the array. If not given, then the type will be determined as the minimum type required to hold the objects in the sequence. This argument can only be used to 'upcast' the array. For downcasting, use the .astype(t) method.

numpy.asarray

numpy.asarray(a)

numpy.empty

numpy.empty(shape, dtype=float, order='C')

numpy.vstack

numpy.vstack(tup)

• 本文已收录于以下专栏：

举报原因： 您举报文章：numpy函数解析 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)