The following URL https://medium.com/@chaimgluck1/working-with-pandas-fixing-messy-column-names-42a54a6659cd gives the answer.