I have a dataframe df1 with columns as partnumber and car.
EXAMPLE:
partnumber car
P1 1
P2 2
P3 1
P4 2
partnumber column needs to be stripped to remove whitespaces, if i run df1['partnumber'] = df1['partnumber'].map(lambda x:str(x).strip())
this changes the sequence of partnumber, please could you advise.