Nov-06-2022, 12:52 PM
(This post was last modified: Nov-06-2022, 12:52 PM by deanhystad.)
I was thinking of using str.join().
You could use join().
import pandas as pd df = pd.read_csv("party.csv") names = ",".join(df["ATTENDEES"]).split(",") print(names)
Output:['John', 'Jan', 'Paul', 'Kylie', 'Paul', 'Scott', 'Jason', 'Jan', 'Scott', 'John']
Quote:Also is there anyway of listing the names up/down rather than left/right.Of course, but you'll need to control the printing yourself instead of using the default str representation of a list.
You could use join().
print("\n".join(names))
Output:John
Jan
Paul
Kylie
Paul
Scott
Jason
Jan
Scott
John
Or you could print a name at a time in a for loop.