janboone/applied-economics

Weird error on column country

Closed this issue · 2 comments

Can someone explain me why is it not reading the first column?

image

I cannot see where you define the dataframe, but most likely country is (part of) the dataframe's index.

If your dataframe is called =df=, do something like

df = df.reset_index()

or

df.reset_index(inplace=True)

https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.reset_index.html

does this help?

Jan.

Indeed the solution was to reset the index!

Thank you