I'm reading a .csv file into a pandas dataframe. I read the file as:
df = pd.read_csv(filepath, sep='\t')
The text headers look like (\s spaces \t tab)
Date\s\s\tPlace\s\s\s\s\s\tLow\s\s\s\s\tHigh\s\s\s\s\t
I'm using the '\t' sep to read in the file into a dataframe. But the problem is if I try to access one of the columns using df['Date'] I get a KeyError: 'Date'. I think there are white-spaces and maybe tabs too that pandas doesn't strip when reading the columns? How can I remove the white spaces and tabs from the column headers?