2019-03-30
阅读量:
413
如何用python实现常用运算(2)
# import pandas for reading csv file
import pandas as pd
#reading csv file
s = pd.read_csv("stock.csv", squeeze = True)
#using describe function
print(s.describe())
#using count function
print(s.idxmax())
#using idxmin function
print(s.idxmin())
#count of elements having value 3
print(s.value_counts().head(3))
Output:
dtype: float64
count 3012.000000
mean 334.310093
std 173.187205
min 49.950000
25% 218.045000
50% 283.315000
75% 443.000000
max 782.220000
Name: Stock Price, dtype: float64
3011
11
291.21 5
288.47 3
194.80 3
Name: Stock Price, dtype: int64






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论