3. Numpy library

3.1. Introduction to the Numpy library

NumPy (Numerical Python) is a powerful numerical computing extension processing library for Python that supports a large number of dimensional arrays and matrix operations. In addition, a large number of mathematical function libraries are provided for array operations. We can see Numpy in many fields of Python applications, such as scientific computing, artificial intelligence, image processing and so on. We can install the Python-NumPy library on the Lubancat board, and write some test codes through jupyter to use the library.

3.2. NumPy library installation

We use the apt tool to install, and what we install here is the Python3 version of the Numpy library. If you need the NumPy library in the Python2 environment, please delete 3 in the following commands by yourself. .. code-block:: bash

# Enter the following command in the terminal to install the numpy library, and wait for the installation to complete: sudo apt -y install python3-numpy

3.3. NumPy library used

After installing the corresponding library, we can use the jupyter installed earlier to write the test code (for jupyter installation, refer to the previous Jupyter Notebook chapter).

The test code and its effects are as follows:

broken

You can upload the supporting code directory “libdemo\Numpy\Numpy.ipynb” file to jupyter for use.

For more information about the use of the Python Numpy library, please refer to NumPy Tutorial