网站如何做引流,百度安装应用,网站建设的意义与价值,网站360全景图怎么做文章目录 随机数据生成的方式list操作方式数据操作方式处理缺失数据数据框操作方式画图的方式 随机数据生成的方式
# 随机生成数据的方式
# 1. 随机生成10-20之间的浮点数
holdForce random.uniform(10,20)
# print(holdForce)# 2.for循环输出50个数据的方式
# for i in rang…
文章目录
随机数据生成的方式
list操作方式
数据操作方式
处理缺失数据
数据框操作方式
画图的方式
随机数据生成的方式
# 随机生成数据的方式# 1. 随机生成10-20之间的浮点数
holdForce = random.uniform(10,20)# print(holdForce)# 2.for循环输出50个数据的方式# for i in range(50):# print(random.uniform(10,20))# 3.其他的写法方式
feelForce=[random.uniform(10,20)for i inrange(50)]
parent=np.array(feelForce)# print(parent)
# 画图的方式import matplotlib.pyplot as plt
x = np.linspace(-100,100,100)
y = np.linspace(-100,100,100)
plt.plot(x,y,color='blue',label='y=x')
plt.show()x =[random.uniform(10,20)for i inrange(9)]
plt.bar(np.arange(len(x)),x,align='edge',color="red")
plt.show()