0
这里是我的查询如何在SQL查询拆分使用Python
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)
我不想硬编码,因为它容易出错,如何假设自动化去做这个?
所以如果我想调用一个块,我只需要调用'df1','df2'等 –
@NabihIbrahimBawazir,不用像df一样在常规Python列表中访问DF' - dfs [0]' - 第一个DF, dfs [1]' - 第二个DF,...等。 – MaxU
所以如果我叫'dfs'它是一个完整的表? –