I import some data from excel to dataframe. In excel there are some cells which are blank (not empty) i.e. someone has pressed spacebar from keyboard to fill that cell in excel, therefore no characters but still looks blank. In dataframe i tried to clean it up with below function. But dataframe doesn't show as NAN after cleaning. Is there a function available so that it can be cleaned?
df.columns = df.columns.str.strip()