how to set the primary key when writing a pandas dataframe to a sqlite database table using df.to_sql

前端 未结 6 862
悲&欢浪女
悲&欢浪女 2020-12-09 05:30

I have created a sqlite database using pandas df.to_sql however accessing it seems considerably slower than just reading in the 500mb csv file.

I need to:

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-09 05:56

    There's no way to do that. You can only set the primary key directly in the database after you move the data.

提交回复
热议问题