#! /anaconda3/bin/python # -*- coding:utf-8 -*- # author: csz time: 2018/9/23 import pymysql from sqlalchemy import create_engine import pandas as pd import tushare as ts """ connection = pymysql.connect(host="localhost", port=3306, user="root", password="19800725", db="TEST", charset="utf8") cursor = connection.cursor() cursor.execute("drop table if exists data_002337") """ data_002337 = ts.get_hist_data("002337") print(type(data_002337)) engine = create_engine("mysql+pymysql://root:19800725@localhost:3306/test?charset=utf8") data_002337.to_sql(name="data_002337", con=engine, if_exists="append", index=True, index_label="date") #"""
加载数据~~~
猜你喜欢
转载自blog.csdn.net/hellocsz/article/details/82922961
今日推荐
周排行