用python数据分析中绘图时代码报错
代码:
import numpy as 数据工具
时间轴 = 数据工具.arrange(10)
print(时间轴)
第一次见 有用中文命名的
numpy.zeros(shape, dtype = float, order = 'C')
创建元素都为0的数组
numpy.ones(shape, dtype = float, order = 'C')
创建元素都为1的数组
numpy.empty(shape, dtype = float, order = 'C')
shape | 数组形状 |
dtype | 数据类型 |
order | 'C'表示行优先,'F'表示列优先(指在计算机内存存储元素的顺序) |
a = np.zeros(10, dtype=np.float32)
print(a)
b = np.ones(10)
print(b)
c = np.empty((2, 2))
print(c)
输出结果:
[0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[[9.90263869e+067 8.01304531e+262]
[2.60799828e-310 1.97643480e-077]]