热线电话:13121318867

登录
2019-03-30 阅读量: 439
如何用python实现常用运算(1)

# import pandas for reading csv file

import pandas as pd

#reading csv file

s = pd.read_csv("stock.csv", squeeze = True)

#using count function

print(s.count())

#using sum function

print(s.sum())

#using mean function

print(s.mean())

#calculatin average

print(s.sum()/s.count())

#using std function

print(s.std())

#using min function

print(s.min())

#using max function

print(s.max())

#using count function

print(s.median())

#using mode function

print(s.mode())

输出:

3012
1006942.0
334.3100929614874
334.3100929614874
173.18720477113115
49.95
782.22
283.315
0 291.21
18.3147
0
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子