简体   繁体   中英

import large excel file into Mysql DB using Python

Dear "never give up" fellow,

After 3 weeks trying to find out a solution, I give up and request your assistance on the following.

I am trying to create a mysql db (done), a table (done) and import an excel file into the created DB (failed) using python (I could use workbench but I decided I must do it in python)

the code is available here (hope it works as this is the first time I use github)
https://github.com/LucTiber/GLBPRS20200412/tree/master
The error I am getting is:

TypeError: "<" not supported between instances of "str" and "float" error message in full can be found on the git page too

I review both the raw and transformed files and could not find any string...

Any clue is more then welcome

Side note for those who are prompt to -1: we are all trying to learn by trying and sometimes it means asking for help from more skillful and ready to share. So be open minded and ready to help. Thanks !

I finally figured out why it was note working MySQL does not like empty dates even if empty is allowed

Fill the empty cells with fake dates like 12/21/2999 and it should work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM