My dataframe has one colum of type list, it looks something like this:
Genre Band
['deep pop r&b', 'indie r&b', 'r&b', 'trap soul'], Elijah Blake
I'm iterating the dataframe using iterrows(), but when I get the column value it is a string, how can I can load as a list?
for i, row in df.iterrows():
artist_genres = row['Genres'] #this is a string
print(artist_genres)
for artist_genre in artist_genres:
print(artist_genre) #this prints each character, I want to iterate each genre
df["Genres"].tolist()artist_genresshould be a list, how did you get it as a string?['[', '\'', 'd', ...]row['Genres']returns a string, even if I saved a list in that dataframe