Answered step by step
Verified Expert Solution
Question
1 Approved Answer
DSC 4 3 0 : Python Programming Assignment 0 8 0 2 : SpotiPy In this assignment, you will use pandas to process a data
DSC : Python Programming
Assignment : SpotiPy
In this assignment, you will use pandas to process a data set of artists and their tracks downloaded from Spotify Web API. This data come in two files: artists.tsv and tracks.tsv both of which have tabseparated values. They contain uniquely identified artists and tracks performed by these artists, respectively. In the former, you can find basic information such as number of followers and genre of the artists, and in the latter, there are information about popularity of the tracks and ID of the artists that performed them.
Note that the IDs in idartists" of tracks.tsv have one or multiple IDs separated by comma and a space These IDs can be matched with the ones in id column of artists.tsv to uniquely identify artists that performed the tracks. Another multivalue column is called "genres" in artists.tsv It shows genres assigned to each artist and the values are separated by comma and a space Below, we define a "jazz artist" as an artist who has at least one value in this column where "jazz" is mentioned eg "jazz pop", "soul jazz", etc. Similarly, a "pop artist" would be an artist that has at least one genre value that has "pop" string. Similar definition goes for other genres.
Load the two tsv files into two Pandas dataframes and use Pandas methods and functions to address the following questions:
Identify and print the name and genre of the artist with maximum number of followers.
Identify and print name of the most productive artist in terms of the number of tracks he performed.
Write a function called summarizegenres genres that takes a list of genres and return a dataframe that has three columns: "genre" name of input genres "total Ntotal number of artists in each genre and Av followers" average number of followers of artists in each genre
Write a function called getgenrevariants genre that takes a genre string and returns an array that includes all variants of that genre ie strings in which that genre is mentioned Try it on "jazz". How many variants of jazz can you find in this data set?
Write a function called
summarizeartistperformance name that takes an artist's name and print the following values: number of tracks, number of solo tracks, number of collaborative tracks, average popularity of totalsolocollaborative tracks, number of people with whom the artists have collaborated. Try it on "Michael Jackson". Are his average totalsolocollaborative track popularities very different?
Record a threeminute video in which you run the code. Then, present your code. Specifically, answer the following questions:
How did you identify artists with maximum number of followers or maximum number of tracks?
How did you detect all artists in a given genre in summarizegenres function? Show the output of this function for the input list pop "hip hop", "rock", "metal", "jazz", "blues", "country", "folklore"
Explain how you classify a track to either a solo or collaborative performance.
Explain how you identified all distinct collaborators of an artist.
Submission: Submit a single py file containing all the code to the DL Do not zip or archive the file. Your code must include comments at the top including your name, date, video link, and the honor statement, "I have not given or received any unauthorized assistance on this assignment." Each function must include a docstring and be commented appropriately.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started