– Start
import numpy as np
import pandas as pd
pd.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 文件创建 DataFrame
df = 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())
– 更多参见:Pandas 精萃
– 声 明:转载请注明出处
– Last Updated on 2018-11-10
– Written by ShangBo on 2018-10-29
– End