- Numpy官网
http://www.numpy.org/
Numpy官网首页展示
官方学习文档:
https://docs.scipy.org/doc/numpy/user/quickstart.html
- Numpy基本用法
import numpy as np
vector = np.array([1,2,3])
vector.shape
vector.size
vector.ndim
type(vector)
# 创建二维数组(矩阵)
matrix = np.array([[1, 2],[3, 4]])
matrix.shape
matrix.size
matrix.ndim
type(matrix)
- 对于矩阵进行转置
one = np.arange(12)
# 0 - 11
one.reshape((3,4))
two = one.reshape((3,4))
two.shape
two.size
two.ndim
网友评论