NumPy

The following creates a NumPy array with evenly spaced values within a specified range:

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

The following argument returns the indices that would sort the input array:

numpy.argsort(a, axis=-1, kind='quicksort', order=None)

The following creates a NumPy array from an array-like sequence, such as a Python list:

numpy.array(object, dtype=None, copy=True, order=None, subok=False, ndmin=0)

The following argument calculates the dot product of two arrays:

numpy.dot(a, b, out=None)

The following argument returns the identity matrix:

numpy.eye(N, M=None, k=0, dtype=<type 'float'>)

The following argument loads NumPy arrays or pickled objects from .npy, .npz or pickles. A memory-mapped array is stored in the filesystem and doesn't have to be completely loaded in memory. This is especially useful for large arrays:

numpy.load(file, mmap_mode=None)

The following argument loads data from a text file into a NumPy array:

numpy.loadtxt(fname, dtype=<type 'float'>, comments='#', delimiter=None, converters=None, skiprows=0, usecols=None, unpack=False, ndmin=0)

The following calculates the arithmetic mean along the given axis:

numpy.mean(a, axis=None, dtype=None, out=None, keepdims=False)

The following argument calculates the median along the given axis:

numpy.median(a, axis=None, out=None, overwrite_input=False)

The following creates a NumPy array of specified shape and data type, containing ones:

numpy.ones(shape, dtype=None, order='C')

The following performs a least squares polynomial fit:

numpy.polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False)

The following changes the shape of a NumPy array:

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

The following argument saves a NumPy array to a file in the NumPy .npy format:

numpy.save(file, arr)

The following argument saves a NumPy array to a text file:

numpy.savetxt(fname, X, fmt='%.18e', delimiter=' ', newline='
', header='', footer='', comments='# ')

The following argument sets printing options:

numpy.set_printoptions(precision=None, threshold=None, edgeitems=None, linewidth=None, suppress=None, nanstr=None, infstr=None, formatter=None)

The following argument returns the standard deviation along the given axis:

numpy.std(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False)

The following selects array elements from input arrays based on a Boolean condition:

numpy.where(condition, [x, y])

The following creates a NumPy array of specified shape and data type, containing zeros:

numpy.zeros(shape, dtype=float, order='C')
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset