Skip to content

Commit

Permalink
remove the 2 unused genres from genres.csv
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeff committed Jun 17, 2020
1 parent bc2548c commit 729ef31
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions creation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,22 @@
" count[genre] += 1\n",
" return count\n",
"\n",
"genres['#tracks'] = count_genres()\n",
"genres[genres['#tracks'] == 0]"
"genres['#tracks'] = count_genres()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Remove unused genres, i.e. genres who are never referenced.\n",
"# So that the length of the table is the number of useful genres.\n",
"print(genres.shape)\n",
"unused_genres = (genres['#tracks'] == 0)\n",
"ipd.display(genres[unused_genres])\n",
"genres.drop(genres.index[unused_genres], inplace=True)\n",
"print(genres.shape)"
]
},
{
Expand Down

0 comments on commit 729ef31

Please sign in to comment.