-4

I have a list with float number separate with a "," and I would like to remove it if it is repeated in the same cell. Thanks.

295091345,2034223 295096523,295096525,295096128,295096128 295096523,295096525,40003, 40003

295091345,2034223 295096523,295096525,295096128 295096523,295096525,40003
I'm trying to that but instead of string I would like to do it with float.

from collections import OrderedDict

df['Desired'] = (df['Current'].str.split() .apply(lambda x: OrderedDict.fromkeys(x).keys()) .str.join(','))

Dodo3
  • 43
  • 7

1 Answers1

0

Hope this helps you:

list = [295096523,295096525,295096128,295096128]
new_list = []
[new_list.append(i) for i in list if i not in new_list]
Tharak Sarvayoni
  • 176
  • 2
  • 14