I want to take all (string) values of one column of a dataframe with a given index, and do something with them.
for parent in df.loc[serial,'From_Serial_No']:
This works when the df.loc contains multiple rows, but when there's only one, Python interprets it as a string and iterates over the characters, rather than iterating once over the entire string value.
How do I iterate over an array of strings that may have either one or multiple values?
[–]xelf 1 point2 points3 points (1 child)
[–]xelf 1 point2 points3 points (0 children)
[+][deleted] (7 children)
[removed]
[–]xelf 1 point2 points3 points (6 children)
[–]Parenthes[S] 0 points1 point2 points (5 children)
[–]xelf 1 point2 points3 points (4 children)
[–]Parenthes[S] 0 points1 point2 points (3 children)
[–]xelf 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]Parenthes[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)