In [158]:
import requests

In [159]:
#Question 1
response = requests.get("https://api.spotify.com/v1/search?q=lil&type=artist&limit=50&market=US")
data = response.json()

In [160]:
type(data)


Out[160]:
dict

In [161]:
data.keys()


Out[161]:
dict_keys(['artists'])

In [162]:
data['artists'].keys()


Out[162]:
dict_keys(['href', 'offset', 'previous', 'limit', 'items', 'next', 'total'])

In [163]:
artists = data['artists']['items']

In [164]:
for artist in artists:
    print(artist['name'], artist['popularity'])


Lil Wayne 86
Lil Yachty 74
Lil Uzi Vert 74
Lil Dicky 69
Boosie Badazz 67
Lil Jon 72
King Lil G 61
Lil Durk 60
Lil Jon & The East Side Boyz 60
Lil Bibby 54
G Herbo 53
Lil Rob 50
Lil Scrappy 50
Lil Reese 50
Bow Wow 57
Lil Keke 48
Lil Wyte 50
Lil Blood 46
Lil Snupe 45
Lil Boom 47
Lil Mama 45
Lil B 44
Lil' Kim 62
Lil Cuete 40
Lil Phat 40
Lil Debbie 43
Lil Twist 40
Lil Trill 37
Lil Goofy 36
Lil Lonnie 37
Lil AJ 37
Lil Haiti 38
Lil Cray 36
Mr. Lil One 36
Lil Twon 36
Lil Mouse 35
Lil Yase 34
Lil Silva 43
Lil Flash 38
Lil Suzy 34
Lil Eddie 41
Lil Rue 34
Lil Kesh 39
Lil Wayne, DJ Drama 35
Lil C 33
Lil Rick 39
Lil E 35
Lil June 32
Lil Fate 34
Lil' Flip 50

Question 2: What genres are most represented in the search results? Edit your previous printout to also display a list of their genres in the format "GENRE_1, GENRE_2, GENRE_3". If there are no genres, print "No genres listed".


In [165]:
#Question 2 awnser.
for artist in artists:
    print(artist['name'], artist['popularity'])
    if len(artist['genres']) == 0:
        print("no genres listed")
    else:
        genres = ", ".join(artist['genres'])
        print("Genres list: ", genres)


Lil Wayne 86
Genres list:  dirty south rap, pop rap, southern hip hop, trap music
Lil Yachty 74
no genres listed
Lil Uzi Vert 74
no genres listed
Lil Dicky 69
no genres listed
Boosie Badazz 67
no genres listed
Lil Jon 72
Genres list:  crunk, dirty south rap, southern hip hop
King Lil G 61
no genres listed
Lil Durk 60
no genres listed
Lil Jon & The East Side Boyz 60
no genres listed
Lil Bibby 54
no genres listed
G Herbo 53
no genres listed
Lil Rob 50
Genres list:  chicano rap, latin hip hop
Lil Scrappy 50
Genres list:  crunk, dirty south rap, southern hip hop, trap music
Lil Reese 50
no genres listed
Bow Wow 57
Genres list:  hip pop, pop rap
Lil Keke 48
no genres listed
Lil Wyte 50
Genres list:  juggalo
Lil Blood 46
no genres listed
Lil Snupe 45
no genres listed
Lil Boom 47
no genres listed
Lil Mama 45
Genres list:  hip pop
Lil B 44
no genres listed
Lil' Kim 62
Genres list:  hip pop
Lil Cuete 40
Genres list:  chicano rap
Lil Phat 40
no genres listed
Lil Debbie 43
no genres listed
Lil Twist 40
Genres list:  jerk
Lil Trill 37
Genres list:  deep trap
Lil Goofy 36
no genres listed
Lil Lonnie 37
no genres listed
Lil AJ 37
no genres listed
Lil Haiti 38
no genres listed
Lil Cray 36
no genres listed
Mr. Lil One 36
Genres list:  chicano rap
Lil Twon 36
no genres listed
Lil Mouse 35
no genres listed
Lil Yase 34
no genres listed
Lil Silva 43
no genres listed
Lil Flash 38
no genres listed
Lil Suzy 34
Genres list:  freestyle
Lil Eddie 41
no genres listed
Lil Rue 34
no genres listed
Lil Kesh 39
no genres listed
Lil Wayne, DJ Drama 35
no genres listed
Lil C 33
no genres listed
Lil Rick 39
Genres list:  soca
Lil E 35
no genres listed
Lil June 32
no genres listed
Lil Fate 34
no genres listed
Lil' Flip 50
Genres list:  crunk, dirty south rap

In [166]:
most_popular_name = ""
most_popular_score = 0

for artist in artists:
    #countring problem:
    followers = artist['followers']
    print(artist['name'], artist['popularity'])
    print(artist['popularity'], "compering to", most_popular_score)
    if artist['popularity'] > most_popular_score:
        print("fund new one!")
        if artist['name'] == "Lil Wayne":
            print("oh, nice try", artist['name'])
        else:
            print("This is the new king!")
            most_popular_name = artist['name']
            most_popular_score = artist['popularity']
    print(artist['name'], followers)   
print('anwser for question 2')
print(most_popular_name," is the most popular of all the lil with", most_popular_score,"of score.")


Lil Wayne 86
86 compering to 0
fund new one!
oh, nice try Lil Wayne
Lil Wayne {'href': None, 'total': 2635716}
Lil Yachty 74
74 compering to 0
fund new one!
This is the new king!
Lil Yachty {'href': None, 'total': 44566}
Lil Uzi Vert 74
74 compering to 74
Lil Uzi Vert {'href': None, 'total': 67468}
Lil Dicky 69
69 compering to 74
Lil Dicky {'href': None, 'total': 235174}
Boosie Badazz 67
67 compering to 74
Boosie Badazz {'href': None, 'total': 222389}
Lil Jon 72
72 compering to 74
Lil Jon {'href': None, 'total': 257332}
King Lil G 61
61 compering to 74
King Lil G {'href': None, 'total': 65645}
Lil Durk 60
60 compering to 74
Lil Durk {'href': None, 'total': 135694}
Lil Jon & The East Side Boyz 60
60 compering to 74
Lil Jon & The East Side Boyz {'href': None, 'total': 17278}
Lil Bibby 54
54 compering to 74
Lil Bibby {'href': None, 'total': 44949}
G Herbo 53
53 compering to 74
G Herbo {'href': None, 'total': 52754}
Lil Rob 50
50 compering to 74
Lil Rob {'href': None, 'total': 36265}
Lil Scrappy 50
50 compering to 74
Lil Scrappy {'href': None, 'total': 27311}
Lil Reese 50
50 compering to 74
Lil Reese {'href': None, 'total': 24074}
Bow Wow 57
57 compering to 74
Bow Wow {'href': None, 'total': 119257}
Lil Keke 48
48 compering to 74
Lil Keke {'href': None, 'total': 18962}
Lil Wyte 50
50 compering to 74
Lil Wyte {'href': None, 'total': 31403}
Lil Blood 46
46 compering to 74
Lil Blood {'href': None, 'total': 5617}
Lil Snupe 45
45 compering to 74
Lil Snupe {'href': None, 'total': 34409}
Lil Boom 47
47 compering to 74
Lil Boom {'href': None, 'total': 343}
Lil Mama 45
45 compering to 74
Lil Mama {'href': None, 'total': 21282}
Lil B 44
44 compering to 74
Lil B {'href': None, 'total': 262}
Lil' Kim 62
62 compering to 74
Lil' Kim {'href': None, 'total': 70915}
Lil Cuete 40
40 compering to 74
Lil Cuete {'href': None, 'total': 15704}
Lil Phat 40
40 compering to 74
Lil Phat {'href': None, 'total': 5390}
Lil Debbie 43
43 compering to 74
Lil Debbie {'href': None, 'total': 14666}
Lil Twist 40
40 compering to 74
Lil Twist {'href': None, 'total': 14862}
Lil Trill 37
37 compering to 74
Lil Trill {'href': None, 'total': 2144}
Lil Goofy 36
36 compering to 74
Lil Goofy {'href': None, 'total': 1361}
Lil Lonnie 37
37 compering to 74
Lil Lonnie {'href': None, 'total': 1455}
Lil AJ 37
37 compering to 74
Lil AJ {'href': None, 'total': 920}
Lil Haiti 38
38 compering to 74
Lil Haiti {'href': None, 'total': 763}
Lil Cray 36
36 compering to 74
Lil Cray {'href': None, 'total': 1030}
Mr. Lil One 36
36 compering to 74
Mr. Lil One {'href': None, 'total': 4779}
Lil Twon 36
36 compering to 74
Lil Twon {'href': None, 'total': 339}
Lil Mouse 35
35 compering to 74
Lil Mouse {'href': None, 'total': 16426}
Lil Yase 34
34 compering to 74
Lil Yase {'href': None, 'total': 1185}
Lil Silva 43
43 compering to 74
Lil Silva {'href': None, 'total': 9582}
Lil Flash 38
38 compering to 74
Lil Flash {'href': None, 'total': 1804}
Lil Suzy 34
34 compering to 74
Lil Suzy {'href': None, 'total': 5962}
Lil Eddie 41
41 compering to 74
Lil Eddie {'href': None, 'total': 1659}
Lil Rue 34
34 compering to 74
Lil Rue {'href': None, 'total': 3308}
Lil Kesh 39
39 compering to 74
Lil Kesh {'href': None, 'total': 1704}
Lil Wayne, DJ Drama 35
35 compering to 74
Lil Wayne, DJ Drama {'href': None, 'total': 12930}
Lil C 33
33 compering to 74
Lil C {'href': None, 'total': 1714}
Lil Rick 39
39 compering to 74
Lil Rick {'href': None, 'total': 1842}
Lil E 35
35 compering to 74
Lil E {'href': None, 'total': 146}
Lil June 32
32 compering to 74
Lil June {'href': None, 'total': 1444}
Lil Fate 34
34 compering to 74
Lil Fate {'href': None, 'total': 113}
Lil' Flip 50
50 compering to 74
Lil' Flip {'href': None, 'total': 20153}
anwser for question 2
Lil Yachty  is the most popular of all the lil with 74 of score.

In [167]:
most_followers_name = ""
most_followers_score = 0
artists = data['artists']['items']
for artist in artists:
    total_followers = artist['followers']['total']
    print(artist['name'], artist['popularity'], total_followers)
    if total_followers > most_followers_score:
        if artist['name'] == "Lil Wayne":
            print("not you wayne")
        else:
            print('updating the new winner')
            most_followers_name = artist['name']
            most_followers_score = total_followers
print("who has more followers?")
print(most_followers_name,"is the winner and has arround", most_followers_score, "followers") 
if most_followers_name != "Lil Yatchy":
    print("Lil Yachty is not the winner in the followers category")


Lil Wayne 86 2635716
not you wayne
Lil Yachty 74 44566
updating the new winner
Lil Uzi Vert 74 67468
updating the new winner
Lil Dicky 69 235174
updating the new winner
Boosie Badazz 67 222389
Lil Jon 72 257332
updating the new winner
King Lil G 61 65645
Lil Durk 60 135694
Lil Jon & The East Side Boyz 60 17278
Lil Bibby 54 44949
G Herbo 53 52754
Lil Rob 50 36265
Lil Scrappy 50 27311
Lil Reese 50 24074
Bow Wow 57 119257
Lil Keke 48 18962
Lil Wyte 50 31403
Lil Blood 46 5617
Lil Snupe 45 34409
Lil Boom 47 343
Lil Mama 45 21282
Lil B 44 262
Lil' Kim 62 70915
Lil Cuete 40 15704
Lil Phat 40 5390
Lil Debbie 43 14666
Lil Twist 40 14862
Lil Trill 37 2144
Lil Goofy 36 1361
Lil Lonnie 37 1455
Lil AJ 37 920
Lil Haiti 38 763
Lil Cray 36 1030
Mr. Lil One 36 4779
Lil Twon 36 339
Lil Mouse 35 16426
Lil Yase 34 1185
Lil Silva 43 9582
Lil Flash 38 1804
Lil Suzy 34 5962
Lil Eddie 41 1659
Lil Rue 34 3308
Lil Kesh 39 1704
Lil Wayne, DJ Drama 35 12930
Lil C 33 1714
Lil Rick 39 1842
Lil E 35 146
Lil June 32 1444
Lil Fate 34 113
Lil' Flip 50 20153
who has more followers?
Lil Jon is the winner and has arround 257332 followers
Lil Yachty is not the winner in the followers category

Question 4 (first part)


In [168]:
#Question 4 (firt part)
for artist in artists:
    if artist['name'] == "Lil' Kim":
        print("found lil kim")
        print(artist['popularity'])


found lil kim
62

In [169]:
#Question 4 (second part)
lil_kim_popularity = 62

# AGGREGATION PROBLEM
more_popular_than_lil_kim = []

# THE LOOP
for artist in artists:
    if artist['popularity'] > lil_kim_popularity:
        print(artist['name'], "is MORE POPULAR with a score of", artist['popularity'])
        more_popular_than_lil_kim.append(artist['name'])
new_list = ", ".join(more_popular_than_lil_kim)
print("Artist that are more popular than Lil Kim:", new_list)


Lil Wayne is MORE POPULAR with a score of 86
Lil Yachty is MORE POPULAR with a score of 74
Lil Uzi Vert is MORE POPULAR with a score of 74
Lil Dicky is MORE POPULAR with a score of 69
Boosie Badazz is MORE POPULAR with a score of 67
Lil Jon is MORE POPULAR with a score of 72
Artist that are more popular than Lil Kim: Lil Wayne, Lil Yachty, Lil Uzi Vert, Lil Dicky, Boosie Badazz, Lil Jon

Question 5 Picking up artists


In [170]:
for artist in artists:
    print(artist['name'], artist['id'] )


Lil Wayne 55Aa2cqylxrFIXC767Z865
Lil Yachty 6icQOAFXDZKsumw3YXyusw
Lil Uzi Vert 4O15NlyKLIASxsJ0PrXPfz
Lil Dicky 1tqhsYv8yBBdwANFNzHtcr
Boosie Badazz 6z7xFFHxYkE9t8bwIF0Bvg
Lil Jon 7sfl4Xt5KmfyDs2T3SVSMK
King Lil G 6L3x3if9RVimruryD9LoFb
Lil Durk 3hcs9uc56yIGFCSy9leWe7
Lil Jon & The East Side Boyz 3ciRvbBIVz9fBoPbtSYq4x
Lil Bibby 4uSN8Y3kgFNVULUWsZEAVW
G Herbo 5QdEbQJ3ylBnc3gsIASAT5
Lil Rob 7B7TGqQe7QTVm2U6q8jzk1
Lil Scrappy 5einkgXXrjhfYCyac1FANB
Lil Reese 1bPxKZtCdjB1aj1csBJpdS
Bow Wow 7352aRY2mqSxBZwzUb6LmA
Lil Keke 1grI9x4Uzos1Asx8JmRW6T
Lil Wyte 21O7WwRkik43ErKppxDKJq
Lil Blood 74nSA5FdDOuuLw7Rn5JnuP
Lil Snupe 42FaEHFfyxTdZQ5W28dXnj
Lil Boom 1mmlWsyPJvvxMdabcGJjRn
Lil Mama 5qK5bOC6wLtuLhG5KvU17c
Lil B 4dqh62yIzDBmrMeBOLiP5F
Lil' Kim 5tth2a3v0sWwV1C7bApBdX
Lil Cuete 1I5u5Umau1AgHl0ZbPL1oR
Lil Phat 3QnIBUOS4mUzs67rZ8r4c9
Lil Debbie 3FNZcjyqT7F5upP99JV0oN
Lil Twist 564gvOqSRcQoYAhaBpTiK2
Lil Trill 5EQERGi7ffHvHsv3bnqzBn
Lil Goofy 3rWaFjgOi5mjQfllMfN3VI
Lil Lonnie 6zSBkdKFLKKggDtE3amfCk
Lil AJ 2jXwYLNnCxNavms4mc1DYM
Lil Haiti 4E9dumwOMLlTyXUp1i2WdI
Lil Cray 43BqexhEx5NKF7VfeOYP9m
Mr. Lil One 6tslWi0BXiDdtChermDzkU
Lil Twon 5YZZbPdI7P7te3lW3dTpzK
Lil Mouse 1cEHxCgGlEgqBc91YOcAEQ
Lil Yase 4vIlHBnzWKbmWe8ZOkT1ZT
Lil Silva 2Kv0ApBohrL213X9avMrEn
Lil Flash 069qBEK34YGoX7nSIT74Eg
Lil Suzy 5HPsVk1MblCoa44WLJsQwN
Lil Eddie 5CY0QKsbUBpQJIE2yycsYi
Lil Rue 4IFVaKBbEO8Qkurg6nmoc4
Lil Kesh 38XiDu0kK3Z5jdHUDqBzNT
Lil Wayne, DJ Drama 65npPa1U4cgobX9wU7Jgpb
Lil C 69swdLSkKxCQBMYJ55O2mA
Lil Rick 1qKzKUnuQsjB83hBZffoq0
Lil E 0zn6yzsbWj3EPMgOTqfG5k
Lil June 3GH3KD2078kLPpEkN1UN26
Lil Fate 6JUnsP7jmvYmdhbg7lTMQj
Lil' Flip 4Q5sPmM8j4SpMqL4UA1DtS

6) Will the world explode if a musicians swears? Get an average popularity for their explicit songs vs. their non-explicit songs. How many minutes of explicit songs do they have? Non-explicit?


In [171]:
#Artist chosen:
#Lil_Uzi_Vert_id = 4O15NlyKLIASxsJ0PrXPfz
#Lil_Dicky_id = 1tqhsYv8yBBdwANFNzHtcr
import requests
response = requests.get("https://api.spotify.com/v1/artists/4O15NlyKLIASxsJ0PrXPfz/top-tracks?country=US")
data2 = response.json()
  • First Lil'Uzi Vert

In [172]:
type(data2)


Out[172]:
dict

In [173]:
data2.keys()


Out[173]:
dict_keys(['tracks'])

In [174]:
type(data2['tracks'])


Out[174]:
list

In [175]:
List_of_explicit_tracks= []
List_of_non_explicit_tracks= []
tracks = data2['tracks']
for track in tracks:
    if track['explicit'] == True:
        print(track['name'], "is explicit")
        List_of_explicit_tracks.append(track['name'])
    else:
        print(track['name'],"with a popularity of", track['popularity'], "is not explicit")
        List_of_non_explicit_tracks.append(track['name'])
  
print("#######")
print(len(List_of_explicit_tracks), "tracks of Lil Uzi are explicit",",",len(List_of_non_explicit_tracks), "tracks are not explicit")


Money Longer is explicit
You Was Right is explicit
Top is explicit
Ps & Qs is explicit
7am is explicit
Canadian Goose is explicit
Hi Roller is explicit
All My Chains is explicit
Baby Are You Home is explicit
Grab the Wheel is explicit
#######
10 tracks of Lil Uzi are explicit , 0 tracks are not explicit

In [176]:
lil_uzi_tracks = tracks

In [153]:
explicit_track_pop_total = 0
non_explicit_track_pop_total = 0
lil_uzi_list_explicit = []
lil_uzi_list_nonexplicit = []
for tracks in lil_uzi_tracks:
    if tracks['explicit'] == True:
        explicit_track_pop_total = explicit_track_pop_total + tracks['popularity']
        lil_uzi_list_explicit.append(explicit_track_pop_total)
        
    elif tracks['explicit'] == False:
        non_explicit_track_pop_total = non_explicit_track_pop_total + tracks['popularity']
        lil_uzi_list_nonexplicit.append(non_explicit_track_pop_total)
        
explicit_track_duration_total = 0
non_explicit_track_duration_total = 0
lil_uzi_list_explicit_dur = []
lil_uzi_list_nonexplicit_dur = []
for tracks in lil_uzi_tracks:
    if tracks['explicit'] == True:
        explicit_track_duration_total = explicit_track_duration_total + tracks['duration_ms']
        lil_uzi_list_explicit_dur.append(explicit_track_duration_total)
        
    elif tracks['explicit'] == False:
        non_explicit_track_pop_total = non_explicit_track_duration_total + tracks['duration_ms']
        lil_uzi_list_nonexplicit_dur.append(non_explicit_track_duration_total)        
        
print("The average of popularity of explicit tracks:", float(sum(lil_uzi_list_explicit))/len(lil_uzi_list_explicit))
print("The average of popularity of non explicit tracks:",sum(lil_uzi_list_nonexplicit)) #We already now this is 0
print("The duration of explicit tracks in minutes:", sum(lil_uzi_list_explicit_dur)/60000)


The average of popularity of explicit tracks: 386.3
The average of popularity of non explicit tracks: 0
The duration of explicit tracks in minutes: 196.67875

In [ ]:

  • Now Lil Dicky

In [177]:
import requests
response = requests.get("https://api.spotify.com/v1/artists/1tqhsYv8yBBdwANFNzHtcr/top-tracks?country=US")
data4 = response.json()
lil_Dicky_tracks = data4

In [154]:
List_of_explicit_tracks2= []
List_of_non_explicit_tracks2= []
tracks2 = lil_Dicky_tracks['tracks']
for track in tracks2:
    if track['explicit'] == True:
        print(track['name'], "is explicit")
        List_of_explicit_tracks2.append(track['name'])
    elif tracks['explicit'] == False:
        print(track['name'],"with a popularity of", track['popularity'], "is not explicit")
        List_of_non_explicit_tracks2.append(track['name'])
  
print("#######")
print(len(List_of_explicit_tracks2), "tracks of Lil Dicky are explicit",",", len(List_of_non_explicit_tracks2), "tracks are not explicit")


$ave Dat Money (feat. Fetty Wap & Rich Homie Quan) is explicit
Professional Rapper (feat. Snoop Dogg) is explicit
Molly (feat. Brendon Urie of Panic at the Disco) is explicit
Lemme Freak is explicit
Personality (feat. T Pain) is explicit
White Crime is explicit
Bruh... is explicit
Pillow Talking (feat. Brain) is explicit
Who Knew is explicit
Oh Well (feat. Jace of Two-9) is explicit
#######
10 tracks of Lil Dicky are explicit , 0 tracks are not explicit

In [182]:
explicit_track_pop_total2 = 0
non_explicit_track_pop_total2 = 0
lil_Dick_list_explicit = []
lil_Dick_list_nonexplicit = []
tracks3 = lil_Dicky_tracks['tracks']
for tracks in tracks3:
    if tracks['explicit'] == True:
        explicit_track_pop_total2 = explicit_track_pop_total2 + tracks['popularity']
        lil_Dick_list_explicit.append(explicit_track_pop_total)
        
    elif tracks['explicit'] == False:
        non_explicit_track_pop_total2 = non_explicit_track_pop_total2 + tracks['popularity']
        lil_Dick_list_nonexplicit.append(non_explicit_track_pop_total)
        explicit_track_duration_total = 0
        
explicit_track_duration_total2 = 0        
non_explicit_track_duration_total2 = 0
lil_Dick_list_explicit_dur = []
lil_Dick_list_nonexplicit_dur = []
tracks3 = lil_Dicky_tracks['tracks']
for tracks in tracks3:
    if tracks['explicit'] == True:
        explicit_track_duration_total2 = explicit_track_duration_total2 + tracks['duration_ms']
        lil_Dick_list_explicit_dur.append(explicit_track_duration_total2)
        
    elif tracks['explicit'] == False:
        non_explicit_track_duration_total2 = non_explicit_track_duration_total2 + tracks['duration_ms']
        lil_Dick_list_nonexplicit_dur.append(non_explicit_track_duration_total2)
        
print("The average of popularity of explicit tracks:", float(sum(lil_Dick_list_explicit))/len(lil_Dick_list_explicit))
print("The average of popularity of non explicit tracks:",sum(lil_Dick_list_nonexplicit)) #We already now this is 0
print("The duration of explicit tracks in minutes:", sum(lil_Dick_list_explicit_dur)/60000)


The average of popularity of explicit tracks: 670.0
The average of popularity of non explicit tracks: 0
The duration of explicit tracks in minutes: 270.24451666666664

7 a) Since we're talking about Lils, what about Biggies? How many total "Biggie" artists are there? How many total "Lil"s? If you made 1 request every 5 seconds, how long would it take to download information on all the Lils vs the Biggies?


In [183]:
# BIGGIE DATA
response = requests.get('https://api.spotify.com/v1/search?query=Biggie&type=artist&limit=50&market=US')
Biggie_data = response.json()

In [184]:
# LIL'S DATA
response = requests.get('https://api.spotify.com/v1/search?query=Lil&type=artist&limit=50&market=US')
Lil_data = response.json()

In [187]:
response = requests.get('https://api.spotify.com/v1/search?query=Lil&type=artist&limit=50&market=US')
Lil_data = response.json()

Biggie_artists = Biggie_data['artists']['total']
Lil_artists = Lil_data['artists']['total']
print("There are", Biggie_artists, "artists named Biggie on Spotify and", Lil_artists, "named with Lil on it",)


There are 50 artists named Biggie on Spotify and 4527 named with Lil on it

In [190]:
Total_Download_Time_Biggie = Biggie_artists / 50 * 5
Total_Download_Time_Lil = Lil_artists / 50 * 5
print("It would take", round(Total_Download_Time_Biggie), "seconds to download all the Biggie artists and", round(Total_Download_Time_Lil), "seconds to download the Lil artists." )


It would take 5 seconds to download all the Biggie artists and 453 seconds to download the Lil artists.

In [193]:
Lil_artists_pop = Lil_data['artists']['items']
for popularity in Lil_artists_pop:
    print(popularity['name'], popularity['popularity'])


Lil Wayne 86
Lil Yachty 74
Lil Uzi Vert 74
Lil Dicky 69
Boosie Badazz 67
Lil Jon 72
King Lil G 61
Lil Durk 60
Lil Jon & The East Side Boyz 60
Lil Bibby 54
G Herbo 53
Lil Rob 50
Lil Scrappy 50
Lil Reese 50
Bow Wow 57
Lil Keke 48
Lil Wyte 50
Lil Blood 46
Lil Snupe 45
Lil Boom 47
Lil Mama 45
Lil B 44
Lil' Kim 62
Lil Cuete 40
Lil Phat 40
Lil Debbie 43
Lil Twist 40
Lil Trill 37
Lil Goofy 36
Lil Lonnie 37
Lil AJ 37
Lil Haiti 38
Lil Cray 36
Mr. Lil One 36
Lil Twon 36
Lil Mouse 35
Lil Yase 34
Lil Silva 43
Lil Flash 38
Lil Suzy 34
Lil Eddie 41
Lil Rue 34
Lil Kesh 39
Lil Wayne, DJ Drama 35
Lil C 33
Lil Rick 39
Lil E 35
Lil June 32
Lil Fate 34
Lil' Flip 50

In [194]:
Biggie_pop = Biggie_data['artists']['items']
for artist in Biggie_pop:
    print(artist['name'], artist['popularity'])


The Notorious B.I.G. 76
Biggie D 20
Biggie 23
Biggie Irie 16
Fabolous|Biggie|Busta|Nate Dogg 11
Biggie Smalls 13
Biggie Paul 17
Biggie the Kid 4
Alief Biggie 4
Papa Biggie 0
Mister Biggie 0
Biggie & Foldy 0
Biggie Bash 6
Dj Majah & Blaq Biggie Blaq 2
Biggie Tembo 1
Louis Biggie 0
Biggie Da Roxter 0
Biggie Dutch 0
Biggie Dutch feat. Marina Wilde 0
MC Biggie 0
Mr Biggie 0
Biggie & Anjay 0
Balder & Biggie 2
Poppa Biggie 0
Biggie Mic 0
Babie Biggie 0
Biggie Moe 0
MC Biggiedoy 0
Biggie Lu 0
Biggie Bandit 0
Biggie Babylon 0
Biggieballzh 0
1000 LBS (Biggie Irie 0
Biggie Brown 0
Biggie Vinkeloe 0
Biggie Sam 0
Crenshaw Biggie 0
Biggie Whit 0
Biggie Smiles 0
Biggie Nabwelela 1
Biggie Roggie Shirima 0
Wandung'u Biggie 0
Biggie Jackson 0
Kevy K Biggie 0
Andrew Biggie 0
Biggie Fab 0
Dj Biggie B 0
Biggie Talls 0
Biggie Smalls Featuring Grand Puba 0
Luke Biggie 0

In [195]:
Lil_artists_pop = Lil_data['artists']['items']
popularity_total = 0
for popularity in Lil_artists_pop:
    popularity_total = popularity_total + popularity['popularity']
print("The average rating for the top 50 artists called Lil is:", round(popularity_total / 50))

Biggie_artists_pop = Biggie_data['artists']['items']
Biggie_popularity_total = 0
for popularity2 in Biggie_artists_pop:
    Biggie_popularity_total = Biggie_popularity_total + popularity2['popularity']
print("The average rating for the top 50 artists called Biggie is:", round(Biggie_popularity_total / 50) )


The average rating for the top 50 artists called Lil is: 47
The average rating for the top 50 artists called Biggie is: 4

In [ ]:


In [ ]: