– Start
import pandas as pd
pd.set_option('display.max_columns', 100)
pd.set_option('display.max_rows', 500)
pd.set_option('display.width', 1000)
# http://www.csindex.com.cn/zh-CN/downloads/indices?lb=%E5%85%A8%E9%83%A8&xl=1
# 通过读取 Excel 文件创建 DataFrame
df = pd.read_excel("index300.xls", sheet_name="Directive Index")
df.dropna(axis=1, inplace=True, thresh=5)
print(df)
groupbyIndexName = df.groupby('指数中文全称Index Chinese Name(Full)')
print(groupbyIndexName.count())
print(groupbyIndexName.mean())
print(groupbyIndexName.sum())
print(groupbyIndexName.std())
print(groupbyIndexName.describe())
print(groupbyIndexName.describe().transpose())
– 更多参见:Pandas 精萃
– 声 明:转载请注明出处
– Last Updated on 2018-11-03
– Written by ShangBo on 2018-11-03
– End