Answers for "remove repetitive characters from the specified column of a given DataFrame"

0

remove repetitive characters from the specified column of a given DataFrame

In [82]:

a.loc[a.diff() != 0]
Out[82]:
1    1
2    2
4    3
5    2
dtype: int64
Posted by: Guest on August-22-2020
0

remove repetitive characters from the specified column of a given DataFrame

cols = ["col1","col2","col3"]
de_dup = a[cols].loc[(a[cols].shift() != a[cols]).any(axis=1)]
Posted by: Guest on August-22-2020

Code answers related to "remove repetitive characters from the specified column of a given DataFrame"

Python Answers by Framework

Browse Popular Code Answers by Language