tushare
Marina-ju
虽恼太迟,又庆幸终于找到了喜欢的事
展开
-
tushare pro的token凭证码设置教程
一,从头像上点击用户名,打开个人主页;二,点击接口token,点击右边纸张图标,复制;在shell中进行如下操作:token=‘你复制下来的token’ts.set_token(token)pro=ts.pro_api()...原创 2019-01-13 18:33:07 · 21120 阅读 · 7 评论 -
在tushare上提取数据并写入mysql中
import numpy as npimport tushare as tsimport MySQLdb as mdbcon=mdb.connect(host=“localhost”,user=“root”,passwd=“123456”,db=“lqj”,use_unicode=True,charset=“utf8”)pro=ts.pro_api()data=pro.stock_bas...原创 2019-01-14 16:51:47 · 3091 阅读 · 0 评论 -
在tushare上提取沪深300指交易数据
import numpy as npimport pandas as pdimport tushare as tsimport MySQLdb as mdb#获取沪深300指数的股票名单hs300_data=ts.get_hs300s()hss=hs300_data[“name”]#获取上交所SSE,深交所SZSE,港交所HKEX正常上市交易的股票名单pro=ts.pro_api(...原创 2019-01-19 20:08:26 · 10668 阅读 · 0 评论 -
优化版:提取指数代码code
import numpy as npimport pandas as pdimport tushare as tsimport MySQLdb as mdb#获取沪深300指数的股票名单hs300_data=ts.get_hs300s()#hss=hs300_data[“name”]#获取上交所SSE,深交所SZSE,港交所HKEX正常上市交易的股票名单pro=ts.pro_api...原创 2019-01-21 16:41:03 · 820 阅读 · 8 评论 -
从tushare中提取股票交易数据并进行聚类分析
import numpy as npimport pandas as pdimport tushare as tsimport MySQLdb as mdbimport matplotlibmatplotlib.use(“TkAgg”)import matplotlib.pyplot as pltfrom matplotlib.collections import LineColle...原创 2019-01-22 08:20:27 · 7852 阅读 · 2 评论