Navy Seal
Navy Seal

Reputation: 125

Cant Call Column

I uploaded UK housing index' data and heres the code for importing,

ukhindex = pd.read_csv('ukhindex.csv')

ukhindex.head()

It returns this table:

enter image description here

However when I try to call the Index column,

ukhindex["Date"].head()

It gives me this error instead.

enter image description here

Here some addition details about my table.

enter image description here

Can someone please help.

Upvotes: 0

Views: 292

Answers (1)

Navy Seal
Navy Seal

Reputation: 125

Not sure why it wasnt picking the column but I just referenced it through column number.

ukhindex.iloc[1:10,4]

it works fine...

Edit : Turns out on the original CSV file each of the colomn headers had a space at the end before the comma. Thats why it wasnt picking them up...

Upvotes: 1

Related Questions