本文共 682 字,大约阅读时间需要 2 分钟。
– Start
import numpy as npimport pandas as pdpd.set_option('display.max_columns', 100)pd.set_option('display.max_rows', 100)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 文件创建 DataFramedf = pd.read_excel("index300.xls", sheet_name="Price Return Index", index_col=0)# 查看所有行print(df)# 查看前 5 行print(df.head())print(df.head(5))# 查看后 5 行print(df.tail())print(df.tail(5))# 查看行标签(index),列标签(columns)和数据print(df.index)print(df.index.names)print(df.columns)print(df.values)# 查看基本统计信息print(df.info())print(df.describe())
– 更多参见:
– 声 明:转载请注明出处 – Last Updated on 2018-11-10 – Written by ShangBo on 2018-10-29 – End