pavelkomarov / exportify

Export Spotify playlists using the Web API. Analyze them in the Jupyter notebook.
https://exportify.net
MIT License
210 stars 24 forks source link

Error: 'float' object has no attribute 'split' when plotting Artist Bar Chart #39

Closed MaltheHoey closed 3 months ago

MaltheHoey commented 11 months ago

I'm experiencing some issues upon plotting the artist bar chart with Exportify. The first script runs without issue, but it seems that there's some error in the Artist column, which I suspect could be empty cells in the CSV, but I'm hoping that the code can run regardless? Any help would be much appreciated

pavelkomarov commented 3 months ago

I haven't run the Jupyter notebook in a really long time. When I do, hopefully I run in to your and others' same issues and can resolve and push a version that works better. I suspect some of the libraries it depends on, which are frequently updated, are causing some drift.

pavelkomarov commented 3 months ago

What was the error, specifically? I'm guessing somewhere in

for i,song in data.iterrows():
    for musician in song['Artist Name(s)'].split(','):
        artists[musician] += 1

you're getting missing artists, so that when you attempt to split() it doesn't work?

pavelkomarov commented 3 months ago

Similar to https://github.com/pavelkomarov/exportify/issues/41, I've added a check:

for i,song in data.iterrows():
    if isinstance(song['Artist Name(s)'], str):
        for musician in song['Artist Name(s)'].split(','):
            artists[musician] += 1