Q:

Python 3 Pandas - Column with extra \n\t\t\t\t\t

I have a dataframe from a .xls spreadsheet and I print off the columns print(df.columns.values) and the output contains a column with the name: Poll Responses\n\t\t\t\t\t. 
I look in the excel sheet and in the cell column header, there's no additional spaces or tabs. 
So in order to get the data from those columns, I have to use print(df['Poll Responses\n\t\t\t\t\t'])
Is this is how it is, or am I doing something wrong? 

A:

Use .str.strip:
df.columns = df.columns.str.strip()

This will strip whitespace from column headings in dataframe.

