python 获取股票数据
2017-08-26 21:05
363 查看
python中的pandas_datareader包中可以查询雅虎的股票数据接口。
pip install pandas_datareader
结果
Open High Low Close Adj Close Volume
Date
2016-01-04 12.9692 13.0539 11.66920 11.66920 11.600797 16362334
2016-01-05 11.0615 11.5923 10.50000 10.92310 10.859071 26990144
2016-01-06 11.0077 11.0769 10.69230 11.06150 10.996658 22404253
2016-01-07 10.7692 10.7692 9.95385 9.95385 9.895501 6225440
2016-01-08 10.1615 10.3462 9.08462 9.83077 9.773143 25633673
Date
2016-01-05 11.0615 11.5923 10.5000 10.9231 10.859071 26990144
2016-01-06 11.0077 11.0769 10.6923 11.0615 10.996658 22404253
12.9692
http://qt.gtimg.cn/q=sh600519 腾讯数据接口
pip install pandas_datareader
from pandas_datareader import data from pandas import ExcelWriter price = data.get_data_yahoo('600624.ss','2016-01-01','2016-03-31') print price.head()获取前五行数据 print price[1:3]获取2,3行数据 print price.iloc[0,0] #获取某一个数据 writer = ExcelWriter('PythonExport1.xlsx')保存为excle文档,文件名 price.to_excel(writer,'Sheet4',encoding='utf_8')表名 writer.save()
结果
Open High Low Close Adj Close Volume
Date
2016-01-04 12.9692 13.0539 11.66920 11.66920 11.600797 16362334
2016-01-05 11.0615 11.5923 10.50000 10.92310 10.859071 26990144
2016-01-06 11.0077 11.0769 10.69230 11.06150 10.996658 22404253
2016-01-07 10.7692 10.7692 9.95385 9.95385 9.895501 6225440
2016-01-08 10.1615 10.3462 9.08462 9.83077 9.773143 25633673
Open High Low Close Adj Close Volume
Date
2016-01-05 11.0615 11.5923 10.5000 10.9231 10.859071 26990144
2016-01-06 11.0077 11.0769 10.6923 11.0615 10.996658 22404253
12.9692
http://qt.gtimg.cn/q=sh600519 腾讯数据接口
相关文章推荐
- Python获取Yahoo股票数据
- Python 获取股票数据 弹出框 自动关闭 测试代码
- Python3获取股票行情数据(中国个股/中国指数/全球指数)
- [Python]通过网易财经接口获取股票和指数的历史数据
- 用Python获取腾迅财经HTTP信息股票数据的方法
- python量化分析系列之---使用python获取股票历史数据和实时分笔数据
- 用Python3获取股票数据实例
- Python股票历史涨跌幅数据获取
- 万得-python接口获取股票数据
- 一个采用python获取股票数据的开源库,相当全,及一些量化投资策略库
- python学习3:获取股票历史数据
- Python获取国内股票数据
- Python3获取股票行情数据(中国个股/中国指数/全球指数)
- python量化分析系列之---python分别使用多线程和多进程获取所有股票实时数据
- python 获取股票的交易数据
- 使用Python来获取国内股票数据的方法:TuShare
- Python3获取股票行情数据(中国个股/中国指数/全球指数)
- Python3获取股票行情数据(中国个股/中国指数/全球指数)
- python分别使用多线程和多进程获取所有股票实时数据
- python量化分系列之---使用tushare获取股票实时分笔数据延时有多大