

作者TheodorePetrou,DunderData
创始人
公司网址,http://www.dunderdata.com(dunder是蒸馏朗姆酒的残留液体,取这个
名字是类比数据分析过程)GitHub地址:https://github.com/tdpetrou领英个人页
面:https://www.linkedin.com/in/tedpetrou推特:https://twitter.com/tedpetrou?
lang=enMedium博客:https://medium.com/@petrou.theodore
#引入pandas和numpy的约定
in[1]:importpandasaspd
importnumpyasnp
1.DataFrame的结构
#设定最大列数和最大行数
in[2]:pd.set_option('max_columns',8,'max_rows',10)
#用read_csv()方法读取csv文件
#head()方法可以查看前五行,head(n)可以查看前n行
in[3]:movie=pd.read_csv('data/movie.csv')
movie.head()
out[3]:
第01章Pandas基础
5