Can't find a mistake

Hey everyone! I’m doing projects in the Data Science Visualization specialization and I’ve just finished Sea Level Project. However, when I copied my code (which works perfectly fine on Repl.it) to PyCharm I got this mistake:

Can somebody please help me to understand what’s wrong?

We’re going to need to see your code to be able to help.

will the repl.it link be good?

That would be helpful. Also, I’d check that your copy-paste maintained the formatting.

https://repl.it/@AlexandraTriant/ShabbyMajorTabs-1

Formatting you mean spaces in def? This is same

I would guess that your CSV is not being read in the same way on PyCharm.

Is your CSV identical? Is the dataframe reading the header correctly? Does it help if you change

1880,0,-0.952755905,0.952755905,

to

1880,0.0,-0.952755905,0.952755905,
1 Like

Thank you so much! I didn’t even think about looking at the csv file. Basically, my Year column was different (it had a date instead of just year), so i did:
pd.DatetimeIndex(df[‘Date’]).year
and now everything works.
Thanks again! :smile:

1 Like