【脚本语言系列】关于Python数值计算Pandas,你需要知道的事
2017-04-25 11:25
1086 查看
如何使用Pandas
安装pandas使用pip安装Pandas或easy_install安装pandas
pip install pandas easy_install pandas
* 使用源文件进行安装
git clone git://github.com/pydata/pandas.git cd pandas python setup.py install
用Pandas估计股票收益的相关性
创建一个字典对象
data = {} for i in xrange(len(symbols)): data[symbols[i]] = numpy.diff(numpy.log(close[i])) df = pandas.DataFrame(data, index = dates[0][:-1], columns = symbols)
2. 操作DataFrame对象
print df.corr() df.plot()
什么是Pandas
Pandas是Python的一个数据分析库。Pandas和R非常相似,其核心为DataFrame。相关文章推荐
- 【脚本语言系列】关于Python数值计算NumPy, 你需要知道的事
- 【脚本语言系列】关于Python基础知识迭代器,你需要知道的事
- 【脚本语言系列】关于Python算法分析,你需要知道的事
- 【脚本语言系列】关于Python文本解析XML,你需要知道的事
- 【脚本语言系列】关于Python多线程编程Threading, 你需要知道的事
- 【脚本语言系列】关于Python基础知识函数缓存,你需要知道的事
- 【脚本语言系列】关于Python进程线程管理系统模块,你需要知道的事
- 【脚本语言系列】关于Python深度学习,你需要知道的事
- 【脚本语言系列】关于Python网页服务Microsoft IIS,你需要知道的事
- 【脚本语言系列】关于PythonWeb服务自动化Web API,你需要知道的事
- 【脚本语言系列】关于PythonWeb客户端标准库requests,你需要知道的事情
- 【脚本语言系列】关于 Python 日志功能,你需要知道的事
- 【脚本语言系列】关于Python结构化文本文件处理xml,你需要知道的事
- 【脚本语言系列】关于Python数据库编程ODBC,你需要知道的事
- 【脚本语言系列】关于Python数据库访问DAO, 你需要知道的事
- 【脚本语言系列】关于Python持久化dbhash,你需要知道的事
- 【脚本语言系列】关于PythonWeb服务自动化webbrowser模块,你需要知道的事
- 【脚本语言系列】关于Python网络通讯socket,你需要知道的事
- 【脚本语言系列】关于PythonWeb服务器apache+mod_wsgi,你需要知道的事
- 【脚本语言系列】关于Python音频处理DirectSound, 你需要知道的事