Skip to content
Advertisement

‘KeyError’ while filling an SQL table with CSV data

I’m currently working on a project that’s requires wrangling OSM data (Udacity Course), and adding it to an SQLite dataset ready for queries.

I’m currently trying to add a ‘.csv’ file to an exisiting SQL table with the following function:

However each time I try to execute it get the following error:

I’m bewildered as to why i’m getting this error. Perhaps the amount of time i’ve spent at the screen all day.

Thank you for any direction / help.

Advertisement

Answer

I found out where the error was. In fact the ‘.csv’ file i had prepared for the SQL database had a ‘b’ value next to each value. This is why it couldn’t find the keys I had identified.

To fix this I modified my osm to csv functions in order to create the csv’s correctly.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement