how to use strip in dataframe code example Example: apply strip() a column in pandas df[0] = df[0].str.strip()