Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- filepath = "C:/abc5/Python/Clustering/output2.csv"
- df = pd.read_csv(filepath,encoding='windows-1252')
- df["newlist"] = df["text_lemmatized"]
- for i in range(0,len(df)):
- l = df["text_lemmatized"][i]
- df["newlist"][i] = list(dict.fromkeys(l))
- print(df)
- ['clear', 'pending', 'order', 'pending', 'order'] ['clear', 'pending', 'order']
- ['pending', 'activation', 'clear', 'pending'] ['pending', 'activation', 'clear']
- ['clear', 'pending', 'order', 'pending', 'order'] ... [[, ', c, l, e, a, r, ,, , p, n, d, i, g, o, ]]
- ['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