【发布时间】:2017-10-18 09:56:22
【问题描述】:
这是我的查询
df = pd.read_sql('SELECT id, timestamp, location_id FROM orders', con=db_connection)
我想拆分到这个
df1 = pd.read_sql('SELECT id, timestamp, location_id FROM orders where id<=1000000', con=db_connection)
...
df100 = pd.read_sql('SELECT id, timestamp, location_id FROM orders where id>99000000 and id<=100000000', con=db_connection )
我不想硬编码,因为它容易出错,假设如何做到这一点?
【问题讨论】:
标签: python sql pandas loops dataframe