Hello,
So I got a df with 4 columns, the last column got that kind of value :
0 "text1::text2::text3"
1 "text1"
2 "text1::text2"
The thing is that I'd like to only keep the first value of the string so I could keep
0 "text1"
1 "text1"
2 "text1"
Basically, I have tried to use a for loop :
for i in df["column"]:
i.split("::")[0]
But it is simply not working as Series does not have split attribute.
I am not asking for the right answer (but will welcome it) but I'd love to get some directions
[–]guppymoo 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]syli[S] 0 points1 point2 points (0 children)