3-3-2-13. Glossary


Below is the summary of all the functions and methods that you learned in this lesson:

Category: General Purpose

numpy.ndarray.dtypeReturn the data-type of the elements of the array. Remember, arrays are homogeneous.
numpy.ndarray.ndimReturn the number of array-dimensions (rank), e.g., it will return 2 for a 4×3 array.
numpy.ndarray.shapeReturn a tuple representing the array dimensions, e.g., it will return (rows,columns) for a rank 2 array.
numpy.ndarray.sizeReturn the number of elements present in the array.
numpy.saveSave an array to .npy (numpy) format.
numpy.loadLoad array from the .npy files.
numpy.random.randomReturn random floats values from the interval [0.0, 1.0), in a specified shape.
numpy.random.randintReturn random integers from the half-open interval [a, b), in a specified shape.
numpy.random.normalReturn random samples from a Gaussian (normal) distribution.
numpy.random.permutationReturn a randomly permuted sequence from the given list
numpy.reshape numpy.ndarray.reshapeReturns an array containing the same elements with a new shape, without affecting the the original array.

Category: Array Creation

numpy.onesReturn a new array of given shape and type, filled with 1s.
numpy.zerosReturn a new array of given shape and type, filled with 0s.
numpy.fullReturn a new array of given shape and type, filled with a specific value.
numpy.eyeReturn a 2-D array with 1s on the diagonal and 0s elsewhere.
numpy.diagExtract the diagonal elements.
numpy.uniqueReturn the sorted unique elements of an array.
numpy.arrayCreate an n-dimensional array.
numpy.arangeReturn evenly spaced values within a given half-open interval [a, b).
numpy.linspaceReturn evenly spaced numbers over a specified interval [a,b].
numpy.ndarray.copyReturns a copy of the array.

Category: Operating with Elements and Indices

numpy.insertInsert values along the given axis before the specified indices.
numpy.deleteReturn a new array, after deleting sub-arrays along a specified axis.
numpy.appendAppend values at the end of the specified array.
numpy.hstackReturn a stacked array formed by stacking the given arrays in sequence horizontally (column-wise).
numpy.vstackReturn a stacked array formed by stacking the given arrays, will be at least 2-D, in sequence vertically (row-wise).
numpy.sortReturn a sorted copy of an array.
numpy.ndarray.sortSort an array in-place.

Category: Set Operations

numpy.intersect1dFind the intersection of two arrays.
numpy.setdiff1dFind the set difference of two arrays.
numpy.union1dReturn the unique, sorted array of values that are in either of the two input arrays.

Category: Arithmetic and Statistical Operations

numpy.addElement-wise add given arrays
numpy.subtractSubtract arguments of given arrays, element-wise.
numpy.multiplyMultiply arguments of given arrays, element-wise.
numpy.divideReturns a true division of the inputs, element-wise.
numpy.expCalculate the exponential of all elements in the input array.
numpy.powerFirst array elements raised to powers from second array, element-wise.
numpy.sqrtReturn the non-negative square-root of an array, element-wise.
numpy.ndarray.minReturn the minimum along the specified axis.
numpy.ndarray.maxReturn the maximum along a given axis.