I have the following dataframe that I created using Pandas:
Name BirthDay
0 Alex 1985-01-01
1 John 1977-01-01
2 Rick 1992-01-01
I need to create separate lists with values from each column. So I do the following:
names = []
birthdays = []
while i < len(df.index):
name = "".join(df['Name'].iloc[i])
birthDay= "".join(df['BirthDay'].iloc[i])
names.append(name)
bithdays.append(birthDay)
i += 1
The code works fine to populate the first list with names, but it throws this error trying to extract dates:
TypeError: can only join an iterable
How am I doing wrong?