Pandas是Python下最强大的数据分析和探索工具。
基本的数据结构是Series和DataFrame。
安装
- 安装完Numpy后,直接使用
pip install pandas
进行安装 - 默认的Pandas不能读写excel文件,支持excel读写需要安装读取
xlrd
和写入xlwt
库
pip install xlrd
#为python添加读取excel功能
pip install xlwt
#为python添加写入excel功能
简单例子
>>> import pandas as pd
>>> s = pd.Series([1,2,3],index=['a','b','c']) #创建一个序列s
>>> print(s)