Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. filepath = "C:/abc5/Python/Clustering/output2.csv"
  2. df = pd.read_csv(filepath,encoding='windows-1252')
  3.  
  4. df["newlist"] = df["text_lemmatized"]
  5. for i in range(0,len(df)):
  6. l = df["text_lemmatized"][i]
  7. df["newlist"][i] = list(dict.fromkeys(l))
  8.  
  9. print(df)
  10.  
  11. ['clear', 'pending', 'order', 'pending', 'order'] ['clear', 'pending', 'order']
  12. ['pending', 'activation', 'clear', 'pending'] ['pending', 'activation', 'clear']
  13.  
  14. ['clear', 'pending', 'order', 'pending', 'order'] ... [[, ', c, l, e, a, r, ,, , p, n, d, i, g, o, ]]
  15. ['pending', 'activation', 'clear', 'pending', ... ... [[, ', p, e, n, d, i, g, ,, , a, c, t, v, o, ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement