Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KeyError
#1
Hello,

I'm currently trying to learn python for career purposes. I was trying to do a few tests to my new recent skills but, unfortunately, I not even being able to pass the first phase.

I'm constantly incurring in a KeyError whenever I try to call any column from my CSV file.

As you can see in the image below, there is no white spaces in the columns names. I don't know what else to do.

CODE PRINTSCREEN IMAGE

Does anyone know why this might happen?
Reply
#2
Looks to me like you've told it your separator is a tab "\t", but in fact columns are separated by semicolons. So it's not finding the columns and you have a single column with a very long name.
Reply
#3
Please, don't post images of code and/or traceback. Copy/paste as text and use BBcode tags.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020