For example, in the row A;AC=a,a;AD=E;AE=W;AF=u,u;AG=Q;AH=R, there is repeated “,a” and “,u”.
The output wanted is A;AC=a;AD=E;AE=W;AF=u;AG=Q;AH=R
It is quite hard to correct the repeated words in the 'info' column. I need to delete the comma and following character.
This is the dataframe:
df = pd.DataFrame([['A','B','C','A;AC=a,a;AD=E;AE=W;AF=u,u;AG=Q;AH=R','F','G'],
['h','k','J','AB=k;AC=5,5;AD=E;AF=W;AG=y,y;AH=Q','L','M'],['O','P','Q','AC=k;AD=e;AE=E;AF=W;AG=y;AH=Q;AK=R','S','T'],
['U','V','W','AC=a;AD=b;AE=r;AF=y;AG=Q;AH=R','Y','Z'],['U','V','W','AC=a;AD=b;AE=r,r;AF=y;AG=Q;AH=R','Y','Z']], columns = ['Col1','Col2','Col3','info','col4','col5'])
We get this result as the diagram.
For example, We see in the 'info' column, "AC=a,a" has a repeated a. We need delete "a" therfore we need to delete the comma too. In the same column, there is "AF=u,u", the "u" character is also repeated, we need to remove "u" and its comma.In the next row, we see "AC=5,5;AD=E;AF=W;AG=y,y", here there is two more character 5,y and their comma.
This the diagram that would be wanted result.
So how to get the final result?

