1. Reference articles:
1,https://blog.csdn.net/yato0514/article/details/78754551
Second, what is numpy:
NumPy (Numeric Python) is a basic package for scientific computing with Python . NumPy is an extension to the Python programming language that adds support for large multidimensional arrays and matrices, as well as a large library of high-level mathematical functions to manipulate these arrays. NumPy provides many advanced numerical programming tools, such as: matrix data types, vector processing, and sophisticated arithmetic libraries. Produced for rigorous digital processing.
Third, install numpy
cd~
sudo apt-get update
sudo apt-get install python-numpy
Note: The first step is best to add, because the second step should be run under the home.
Fourth, the test
python
from numpy import *
a=arange(12)
a=a.reshape(3,2,2)
print(a)
Note: The first sentence python should be added. Because we have to enter python first, and then we call numpy.
The result of the operation is as follows:
[[[ 0 1]
[ 2 3]]
[[ 4 5]
[ 6 7]]
[[ 8 9]
[10 11]]]