1. Numpy#
The numpy package is one of the main packages when it comes to working with arrays and matrices in Python, making it indispensable to process and visualize scientific data. Its assortment of routines facilitates operations such as mathematical, logical, linear algebra, Fourier transforms, and much more. In this section, you will learn some of the most used numpy functions to work with multidimensional array objects.
Previously in this course you have already encountered lists, which are created with square brackets []. Arrays are the numpy equivalent of lists, with a few characteristic traits:
- numpy arrays can only store one type of element,
- numpy arrays take up much less memory than lists,
- numpy arrays have a much better runtime behavior,
- it is easier to work with multi-dimensional numpy arrays than with multi-dimensional lists
The following functions will be discussed in this Notebook:
np.array()np.zeros()np.asarray()np.shape()np.min()np.max()np.mean()np.sort()np.linspace()np.arange()np.argmax()np.argmin()np.where()np.astype()np.dot()np.transpose()np.loadtxt()np.sum()np.cos()np.sin()np.sqrt()