参考
以下で保存したデータを今度は取得してみる
コード
select_histdata_from_table.py
import mysql.connector as mydb
import pandas as pd
conn = mydb.connect(
host='hostname',
port='3306',
user='user',
password='pass',
database='fx'
)
conn.ping(reconnect=True)
cursor = conn.cursor()
df = pd.read_sql_query(sql='select * from usdjpy where date between "2021-01-01" and "2021-03-31"', con=conn)
df['date'] = pd.to_datetime(df.date)
df.set_index('date', inplace=True)
print(df.head())
完走した感想
簡単すぎィィィィ