1、Numpy
安装:pip install numpy
[root@kvm work]# cat numpy_test.py #!/usr/bin/env python #coding:utf-8 from __future__ import print_function # 导入模块并添加别名 import numpy as np # 创建数组 a = np.array([2,0,1,7]) print(a) print(a[:3]) print(a.min()) a.sort() print(a) # 创建二维数据 b = np.array([[1,2,3],[4,5,6]]) print(b) print(b*b) [root@kvm work]# python numpy_test.py [2 0 1 7] [2 0 1] 0 [0 1 2 7] [[1 2 3] [4 5 6]] [[ 1 4 9] [16 25 36]]
简单使用