![](https://img-blog.csdnimg.cn/20200328124536247.jpg?x-oss-process=image/resize,m_fixed,h_224,w_224)
Python
Python是一种跨平台的计算机程序设计语言。 是一个高层次的结合了解释性、编译性、互动性和面向对象的脚本语言。最初被设计用于编写自动化脚本(shell),随着版本的不断更新和语言新功能的添加,越多被用于独立的、大型项目的开发。
今晚没吃饭啊
这个作者很懒,什么都没留下…
展开
-
【NumPy学习】04: 创建数组
import numpy as np #1 numpy.empty 创建一个指定形状(shape)、数据类型(dtype)且未初始化的数组 # 创建空数组 (注意 − 数组元素为随机值,因为它们未初始化) # numpy.empty(shape, dtype = float, order = 'C') x1 = np.empty([3,2],dtype=int) print(x1) #2...原创 2020-03-28 12:33:51 · 197 阅读 · 0 评论 -
【NumPy学习】03: 数组属性
import numpy as np #1 ndarray.ndim 用于返回数组的维数,等于秩。 a1 = np.arange(24) print(a1.ndim) # a 现只有一个维度 # 现在调整其大小 # reshape(self, shape, order) b1 = a1.reshape(2,4,3) # b 现在拥有三个维度 print(b1.ndim) #2 nd...原创 2020-03-28 12:30:10 · 128 阅读 · 0 评论 -
【NumPy学习】02: 数据类型
import numpy as np #1 使用标量类型 dt1 = np.dtype(np.int32) print(dt1) #2 int8, int16, int32, int64 四种数据类型可以使用字符串 'i1', 'i2','i4','i8' 代替 dt2 = np.dtype('i4') print(dt2) #3 字节顺序标注 dt3 = np.dtype('<...原创 2020-03-28 12:27:09 · 139 阅读 · 0 评论 -
【NumPy学习】01: Ndarray 对象
import numpy as np #一维 a = np.array([1,2,3]) #二维 b = np.array([[1,2],[3,4]]) #最小维度 # ndmin 指定生成数组的最小维度 c = np.array([1,2,3,4,5], ndmin=2) # dtype 参数 d = np.array([1,2,3], dtype=complex) print(a...原创 2020-03-28 12:22:53 · 162 阅读 · 0 评论