美文网首页
python查看数据

python查看数据

作者: 彬彬刘 | 来源:发表于2020-04-24 12:17 被阅读0次
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 文件创建 
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())

相关文章

网友评论

      本文标题:python查看数据

      本文链接:https://www.haomeiwen.com/subject/ltaxwhtx.html