how to transform pandas dataframe for insertion via executemany() statement?

前端 未结 3 1837
天命终不由人
天命终不由人 2020-12-30 04:01

I have a fairly big pandas dataframe - 50 or so headers and a few hundred thousand rows of data - and I\'m looking to transfer this data to a database using the

3条回答
  •  别那么骄傲
    2020-12-30 04:32

    You can try this:

    cursor.executemany(sql_str, your_dataframe.values.tolist())
    

    Hope it helps.

提交回复
热议问题