remove repetitive characters from the specified column of a given dataframe

Solutions on MaxInterview for remove repetitive characters from the specified column of a given dataframe by the best coders in the world

showing results for - "remove repetitive characters from the specified column of a given dataframe"
Giorgio
06 Sep 2019
1In [82]:
2
3a.loc[a.diff() != 0]
4Out[82]:
51    1
62    2
74    3
85    2
9dtype: int64
Elyes
01 Jun 2016
1cols = ["col1","col2","col3"]
2de_dup = a[cols].loc[(a[cols].shift() != a[cols]).any(axis=1)]