Created
January 14, 2015 02:06
-
-
Save talwai/6ebc9a75fdfd97a81843 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ten_most_prolific(rows): | |
# Who are the top 10 most prolific artists in the data | |
# along with the number of their songs that appear in the data? | |
artists = [row['ARTIST CLEAN'] for row in rows] | |
c = Counter(artists) | |
sorted_c = sorted(c.items(), key=operator.itemgetter(1), reverse=True) | |
return sorted_c[:10] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment