Data Preperation¶

data set: https://www.kaggle.com/datasets/yamaerenay/spotify-dataset-19212020-600k-tracks¶

In [ ]:
import pandas as pd
import numpy as np
import json
import re
import sys
import itertools
In [ ]:
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.preprocessing import MinMaxScaler
import matplotlib.pyplot as plt
In [ ]:
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
from spotipy.oauth2 import SpotifyOAuth
import spotipy.util as util
In [ ]:
import warnings
warnings.filterwarnings("ignore")
In [ ]:
%matplotlib inline
In [ ]:
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:90% !important; }</style>"))
In [ ]:
genres_df= pd.read_csv("/Users/victoriapuck-karam/Documents/musicdata/genres_v2.csv")
genres_df # with genre information 
Out[ ]:
danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo type id uri track_href analysis_url duration_ms time_signature genre song_name Unnamed: 0 title
0 0.831 0.814 2 -7.364 1 0.4200 0.059800 0.013400 0.0556 0.3890 156.985 audio_features 2Vc6NJ9PW9gD9q343XFRKx spotify:track:2Vc6NJ9PW9gD9q343XFRKx https://api.spotify.com/v1/tracks/2Vc6NJ9PW9gD... https://api.spotify.com/v1/audio-analysis/2Vc6... 124539 4 Dark Trap Mercury: Retrograde NaN NaN
1 0.719 0.493 8 -7.230 1 0.0794 0.401000 0.000000 0.1180 0.1240 115.080 audio_features 7pgJBLVz5VmnL7uGHmRj6p spotify:track:7pgJBLVz5VmnL7uGHmRj6p https://api.spotify.com/v1/tracks/7pgJBLVz5Vmn... https://api.spotify.com/v1/audio-analysis/7pgJ... 224427 4 Dark Trap Pathology NaN NaN
2 0.850 0.893 5 -4.783 1 0.0623 0.013800 0.000004 0.3720 0.0391 218.050 audio_features 0vSWgAlfpye0WCGeNmuNhy spotify:track:0vSWgAlfpye0WCGeNmuNhy https://api.spotify.com/v1/tracks/0vSWgAlfpye0... https://api.spotify.com/v1/audio-analysis/0vSW... 98821 4 Dark Trap Symbiote NaN NaN
3 0.476 0.781 0 -4.710 1 0.1030 0.023700 0.000000 0.1140 0.1750 186.948 audio_features 0VSXnJqQkwuH2ei1nOQ1nu spotify:track:0VSXnJqQkwuH2ei1nOQ1nu https://api.spotify.com/v1/tracks/0VSXnJqQkwuH... https://api.spotify.com/v1/audio-analysis/0VSX... 123661 3 Dark Trap ProductOfDrugs (Prod. The Virus and Antidote) NaN NaN
4 0.798 0.624 2 -7.668 1 0.2930 0.217000 0.000000 0.1660 0.5910 147.988 audio_features 4jCeguq9rMTlbMmPHuO7S3 spotify:track:4jCeguq9rMTlbMmPHuO7S3 https://api.spotify.com/v1/tracks/4jCeguq9rMTl... https://api.spotify.com/v1/audio-analysis/4jCe... 123298 4 Dark Trap Venom NaN NaN
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
42300 0.528 0.693 4 -5.148 1 0.0304 0.031500 0.000345 0.1210 0.3940 150.013 audio_features 46bXU7Sgj7104ZoXxzz9tM spotify:track:46bXU7Sgj7104ZoXxzz9tM https://api.spotify.com/v1/tracks/46bXU7Sgj710... https://api.spotify.com/v1/audio-analysis/46bX... 269208 4 hardstyle NaN 20995.0 Euphoric Hardstyle
42301 0.517 0.768 0 -7.922 0 0.0479 0.022500 0.000018 0.2050 0.3830 149.928 audio_features 0he2ViGMUO3ajKTxLOfWVT spotify:track:0he2ViGMUO3ajKTxLOfWVT https://api.spotify.com/v1/tracks/0he2ViGMUO3a... https://api.spotify.com/v1/audio-analysis/0he2... 210112 4 hardstyle NaN 20996.0 Greatest Hardstyle Playlist
42302 0.361 0.821 8 -3.102 1 0.0505 0.026000 0.000242 0.3850 0.1240 154.935 audio_features 72DAt9Lbpy9EUS29OzQLob spotify:track:72DAt9Lbpy9EUS29OzQLob https://api.spotify.com/v1/tracks/72DAt9Lbpy9E... https://api.spotify.com/v1/audio-analysis/72DA... 234823 4 hardstyle NaN 20997.0 Best of Hardstyle 2020
42303 0.477 0.921 6 -4.777 0 0.0392 0.000551 0.029600 0.0575 0.4880 150.042 audio_features 6HXgExFVuE1c3cq9QjFCcU spotify:track:6HXgExFVuE1c3cq9QjFCcU https://api.spotify.com/v1/tracks/6HXgExFVuE1c... https://api.spotify.com/v1/audio-analysis/6HXg... 323200 4 hardstyle NaN 20998.0 Euphoric Hardstyle
42304 0.529 0.945 9 -5.862 1 0.0615 0.001890 0.000055 0.4140 0.1340 155.047 audio_features 6MAAMZImxcvYhRnxDLTufD spotify:track:6MAAMZImxcvYhRnxDLTufD https://api.spotify.com/v1/tracks/6MAAMZImxcvY... https://api.spotify.com/v1/audio-analysis/6MAA... 162161 4 hardstyle NaN 20999.0 Best of Hardstyle 2020

42305 rows × 22 columns

In [ ]:
genres_df['genre'].values[42205]
Out[ ]:
'hardstyle'
In [ ]:
genres_df.dtypes
Out[ ]:
danceability        float64
energy              float64
key                   int64
loudness            float64
mode                  int64
speechiness         float64
acousticness        float64
instrumentalness    float64
liveness            float64
valence             float64
tempo               float64
type                 object
id                   object
uri                  object
track_href           object
analysis_url         object
duration_ms           int64
time_signature        int64
genre                object
song_name            object
Unnamed: 0          float64
title                object
dtype: object
In [ ]:
tracks_df= pd.read_csv("/Users/victoriapuck-karam/Documents/musicdata/tracks.csv")
tracks_df #without genre information 
Out[ ]:
id name popularity duration_ms explicit artists id_artists release_date danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo time_signature
0 35iwgR4jXetI318WEWsa1Q Carve 6 126903 0 ['Uli'] ['45tIt06XoI0Iio4LBEVpls'] 1922-02-22 0.645 0.4450 0 -13.338 1 0.4510 0.674 0.744000 0.1510 0.1270 104.851 3
1 021ht4sdgPcrDgSk7JTbKY Capítulo 2.16 - Banquero Anarquista 0 98200 0 ['Fernando Pessoa'] ['14jtPCOoNZwquk5wd9DxrY'] 1922-06-01 0.695 0.2630 0 -22.136 1 0.9570 0.797 0.000000 0.1480 0.6550 102.009 1
2 07A5yehtSnoedViJAZkNnc Vivo para Quererte - Remasterizado 0 181640 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.434 0.1770 1 -21.180 1 0.0512 0.994 0.021800 0.2120 0.4570 130.418 5
3 08FmqUhxtyLTn6pAh6bk45 El Prisionero - Remasterizado 0 176907 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.321 0.0946 7 -27.961 1 0.0504 0.995 0.918000 0.1040 0.3970 169.980 3
4 08y9GfoqCWfOGsKdwojr5e Lady of the Evening 0 163080 0 ['Dick Haymes'] ['3BiJGZsyX9sJchTqcSA7Su'] 1922 0.402 0.1580 3 -16.900 0 0.0390 0.989 0.130000 0.3110 0.1960 103.220 4
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
586667 5rgu12WBIHQtvej2MdHSH0 云与海 50 258267 0 ['阿YueYue'] ['1QLBXKM5GCpyQQSVMNZqrZ'] 2020-09-26 0.560 0.5180 0 -7.471 0 0.0292 0.785 0.000000 0.0648 0.2110 131.896 4
586668 0NuWgxEp51CutD2pJoF4OM blind 72 153293 0 ['ROLE MODEL'] ['1dy5WNgIKQU6ezkpZs4y8z'] 2020-10-21 0.765 0.6630 0 -5.223 1 0.0652 0.141 0.000297 0.0924 0.6860 150.091 4
586669 27Y1N4Q4U3EfDU5Ubw8ws2 What They'll Say About Us 70 187601 0 ['FINNEAS'] ['37M5pPGs6V1fchFJSgCguX'] 2020-09-02 0.535 0.3140 7 -12.823 0 0.0408 0.895 0.000150 0.0874 0.0663 145.095 4
586670 45XJsGpFTyzbzeWK8VzR8S A Day At A Time 58 142003 0 ['Gentle Bones', 'Clara Benin'] ['4jGPdu95icCKVF31CcFKbS', '5ebPSE9YI5aLeZ1Z2g... 2021-03-05 0.696 0.6150 10 -6.212 1 0.0345 0.206 0.000003 0.3050 0.4380 90.029 4
586671 5Ocn6dZ3BJFPWh4ylwFXtn Mar de Emociones 38 214360 0 ['Afrosound'] ['0i4Qda0k4nf7jnNHmSNpYv'] 2015-07-01 0.686 0.7230 6 -7.067 1 0.0363 0.105 0.000000 0.2640 0.9750 112.204 4

586672 rows × 20 columns

In [ ]:
tracks_df.dtypes
Out[ ]:
id                   object
name                 object
popularity            int64
duration_ms           int64
explicit              int64
artists              object
id_artists           object
release_date         object
danceability        float64
energy              float64
key                   int64
loudness            float64
mode                  int64
speechiness         float64
acousticness        float64
instrumentalness    float64
liveness            float64
valence             float64
tempo               float64
time_signature        int64
dtype: object
In [ ]:
genres_df['id']= genres_df['id'].convert_dtypes()# with genre information 
tracks_df['id']= tracks_df['id'].convert_dtypes() #without genre information 

Formatting of artist data, various forms including lists¶

In [ ]:
genres_df['genre'].values[0]
Out[ ]:
'Dark Trap'
In [ ]:
tracks_df['artists'].values[0]
Out[ ]:
"['Uli']"
In [ ]:
tracks_df['artists'].values[0][0]
Out[ ]:
'['
In [ ]:
tracks_df['artists_upd_v1'] = tracks_df['artists'].apply(lambda x: re.findall(r"'([^']*)'", x))
In [ ]:
tracks_df['artists_upd_v1'].values[0][0]
Out[ ]:
'Uli'
In [ ]:
tracks_df[tracks_df['artists_upd_v1'].apply(lambda x: not x)].head(5)
Out[ ]:
id name popularity duration_ms explicit artists id_artists release_date danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo time_signature artists_upd_v1
164 1xEEYhWxT4WhDQdxfPCT8D Snake Rag 20 194533 0 ["King Oliver's Creole Jazz Band"] ['08Zk65toyJllap1MnzljxZ'] 1923 0.708 0.361 0 -11.764 0 0.0441 0.994 0.883 0.103 0.902 105.695 4 []
170 3rauXVLOOM5BlxWqUcDpkg Chimes Blues 14 170827 0 ["King Oliver's Creole Jazz Band"] ['08Zk65toyJllap1MnzljxZ'] 1923 0.546 0.189 0 -15.984 1 0.0581 0.996 0.908 0.339 0.554 80.318 4 []
172 1UdqHVRFYMZKU2Q7xkLtYc Pickin' On Your Baby 11 197493 0 ["Clarence Williams' Blue Five"] ['6RuQvIr0t0otZHnAxXTGkm'] 1923 0.520 0.153 0 -14.042 1 0.0440 0.995 0.131 0.353 0.319 102.937 4 []
174 0Vl2DO5U6FjgBpzCtBN3OA Everybody Loves My Baby 10 152507 0 ["Clarence Williams' Blue Five"] ['6RuQvIr0t0otZHnAxXTGkm'] 1923 0.514 0.193 2 -13.920 0 0.2380 0.996 0.199 0.248 0.665 180.674 4 []
180 5SvyP1ZeJX1jA7AOZD08NA Tears 10 187227 0 ["King Oliver's Creole Jazz Band"] ['08Zk65toyJllap1MnzljxZ'] 1923 0.359 0.357 3 -11.810 1 0.0511 0.994 0.819 0.290 0.753 205.053 4 []
In [ ]:
tracks_df['artists_upd_v2'] = tracks_df['artists'].apply(lambda x: re.findall('\"(.*?)\"',x))
In [ ]:
tracks_df['artists_upd'] = np.where(tracks_df['artists_upd_v1'].apply(lambda x: not x), tracks_df['artists_upd_v2'], tracks_df['artists_upd_v1'] )
In [ ]:
tracks_df.convert_dtypes()
Out[ ]:
id name popularity duration_ms explicit artists id_artists release_date danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo time_signature artists_upd_v1 artists_upd_v2 artists_upd
0 35iwgR4jXetI318WEWsa1Q Carve 6 126903 0 ['Uli'] ['45tIt06XoI0Iio4LBEVpls'] 1922-02-22 0.645 0.445 0 -13.338 1 0.451 0.674 0.744 0.151 0.127 104.851 3 [Uli] [] [Uli]
1 021ht4sdgPcrDgSk7JTbKY Capítulo 2.16 - Banquero Anarquista 0 98200 0 ['Fernando Pessoa'] ['14jtPCOoNZwquk5wd9DxrY'] 1922-06-01 0.695 0.263 0 -22.136 1 0.957 0.797 0.0 0.148 0.655 102.009 1 [Fernando Pessoa] [] [Fernando Pessoa]
2 07A5yehtSnoedViJAZkNnc Vivo para Quererte - Remasterizado 0 181640 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.434 0.177 1 -21.18 1 0.0512 0.994 0.0218 0.212 0.457 130.418 5 [Ignacio Corsini] [] [Ignacio Corsini]
3 08FmqUhxtyLTn6pAh6bk45 El Prisionero - Remasterizado 0 176907 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.321 0.0946 7 -27.961 1 0.0504 0.995 0.918 0.104 0.397 169.98 3 [Ignacio Corsini] [] [Ignacio Corsini]
4 08y9GfoqCWfOGsKdwojr5e Lady of the Evening 0 163080 0 ['Dick Haymes'] ['3BiJGZsyX9sJchTqcSA7Su'] 1922 0.402 0.158 3 -16.9 0 0.039 0.989 0.13 0.311 0.196 103.22 4 [Dick Haymes] [] [Dick Haymes]
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
586667 5rgu12WBIHQtvej2MdHSH0 云与海 50 258267 0 ['阿YueYue'] ['1QLBXKM5GCpyQQSVMNZqrZ'] 2020-09-26 0.56 0.518 0 -7.471 0 0.0292 0.785 0.0 0.0648 0.211 131.896 4 [阿YueYue] [] [阿YueYue]
586668 0NuWgxEp51CutD2pJoF4OM blind 72 153293 0 ['ROLE MODEL'] ['1dy5WNgIKQU6ezkpZs4y8z'] 2020-10-21 0.765 0.663 0 -5.223 1 0.0652 0.141 0.000297 0.0924 0.686 150.091 4 [ROLE MODEL] [] [ROLE MODEL]
586669 27Y1N4Q4U3EfDU5Ubw8ws2 What They'll Say About Us 70 187601 0 ['FINNEAS'] ['37M5pPGs6V1fchFJSgCguX'] 2020-09-02 0.535 0.314 7 -12.823 0 0.0408 0.895 0.00015 0.0874 0.0663 145.095 4 [FINNEAS] [] [FINNEAS]
586670 45XJsGpFTyzbzeWK8VzR8S A Day At A Time 58 142003 0 ['Gentle Bones', 'Clara Benin'] ['4jGPdu95icCKVF31CcFKbS', '5ebPSE9YI5aLeZ1Z2g... 2021-03-05 0.696 0.615 10 -6.212 1 0.0345 0.206 0.000003 0.305 0.438 90.029 4 [Gentle Bones, Clara Benin] [] [Gentle Bones, Clara Benin]
586671 5Ocn6dZ3BJFPWh4ylwFXtn Mar de Emociones 38 214360 0 ['Afrosound'] ['0i4Qda0k4nf7jnNHmSNpYv'] 2015-07-01 0.686 0.723 6 -7.067 1 0.0363 0.105 0.0 0.264 0.975 112.204 4 [Afrosound] [] [Afrosound]

586672 rows × 23 columns

In [ ]:
tracks_df.dtypes
Out[ ]:
id                   string
name                 object
popularity            int64
duration_ms           int64
explicit              int64
artists              object
id_artists           object
release_date         object
danceability        float64
energy              float64
key                   int64
loudness            float64
mode                  int64
speechiness         float64
acousticness        float64
instrumentalness    float64
liveness            float64
valence             float64
tempo               float64
time_signature        int64
artists_upd_v1       object
artists_upd_v2       object
artists_upd          object
dtype: object
In [ ]:
tracks_df
Out[ ]:
id name popularity duration_ms explicit artists id_artists release_date danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo time_signature artists_upd_v1 artists_upd_v2 artists_upd
0 35iwgR4jXetI318WEWsa1Q Carve 6 126903 0 ['Uli'] ['45tIt06XoI0Iio4LBEVpls'] 1922-02-22 0.645 0.4450 0 -13.338 1 0.4510 0.674 0.744000 0.1510 0.1270 104.851 3 [Uli] [] [Uli]
1 021ht4sdgPcrDgSk7JTbKY Capítulo 2.16 - Banquero Anarquista 0 98200 0 ['Fernando Pessoa'] ['14jtPCOoNZwquk5wd9DxrY'] 1922-06-01 0.695 0.2630 0 -22.136 1 0.9570 0.797 0.000000 0.1480 0.6550 102.009 1 [Fernando Pessoa] [] [Fernando Pessoa]
2 07A5yehtSnoedViJAZkNnc Vivo para Quererte - Remasterizado 0 181640 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.434 0.1770 1 -21.180 1 0.0512 0.994 0.021800 0.2120 0.4570 130.418 5 [Ignacio Corsini] [] [Ignacio Corsini]
3 08FmqUhxtyLTn6pAh6bk45 El Prisionero - Remasterizado 0 176907 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.321 0.0946 7 -27.961 1 0.0504 0.995 0.918000 0.1040 0.3970 169.980 3 [Ignacio Corsini] [] [Ignacio Corsini]
4 08y9GfoqCWfOGsKdwojr5e Lady of the Evening 0 163080 0 ['Dick Haymes'] ['3BiJGZsyX9sJchTqcSA7Su'] 1922 0.402 0.1580 3 -16.900 0 0.0390 0.989 0.130000 0.3110 0.1960 103.220 4 [Dick Haymes] [] [Dick Haymes]
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
586667 5rgu12WBIHQtvej2MdHSH0 云与海 50 258267 0 ['阿YueYue'] ['1QLBXKM5GCpyQQSVMNZqrZ'] 2020-09-26 0.560 0.5180 0 -7.471 0 0.0292 0.785 0.000000 0.0648 0.2110 131.896 4 [阿YueYue] [] [阿YueYue]
586668 0NuWgxEp51CutD2pJoF4OM blind 72 153293 0 ['ROLE MODEL'] ['1dy5WNgIKQU6ezkpZs4y8z'] 2020-10-21 0.765 0.6630 0 -5.223 1 0.0652 0.141 0.000297 0.0924 0.6860 150.091 4 [ROLE MODEL] [] [ROLE MODEL]
586669 27Y1N4Q4U3EfDU5Ubw8ws2 What They'll Say About Us 70 187601 0 ['FINNEAS'] ['37M5pPGs6V1fchFJSgCguX'] 2020-09-02 0.535 0.3140 7 -12.823 0 0.0408 0.895 0.000150 0.0874 0.0663 145.095 4 [FINNEAS] [] [FINNEAS]
586670 45XJsGpFTyzbzeWK8VzR8S A Day At A Time 58 142003 0 ['Gentle Bones', 'Clara Benin'] ['4jGPdu95icCKVF31CcFKbS', '5ebPSE9YI5aLeZ1Z2g... 2021-03-05 0.696 0.6150 10 -6.212 1 0.0345 0.206 0.000003 0.3050 0.4380 90.029 4 [Gentle Bones, Clara Benin] [] [Gentle Bones, Clara Benin]
586671 5Ocn6dZ3BJFPWh4ylwFXtn Mar de Emociones 38 214360 0 ['Afrosound'] ['0i4Qda0k4nf7jnNHmSNpYv'] 2015-07-01 0.686 0.7230 6 -7.067 1 0.0363 0.105 0.000000 0.2640 0.9750 112.204 4 [Afrosound] [] [Afrosound]

586672 rows × 23 columns

In [ ]:
tracks_df['artists_upd3']= tracks_df['artists_upd'].astype(str)
In [ ]:
tracks_df['names_strs']=tracks_df['name'].astype(str)
In [ ]:
tracks_df
Out[ ]:
id name popularity duration_ms explicit artists id_artists release_date danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo time_signature artists_upd_v1 artists_upd_v2 artists_upd artists_upd3 names_strs
0 35iwgR4jXetI318WEWsa1Q Carve 6 126903 0 ['Uli'] ['45tIt06XoI0Iio4LBEVpls'] 1922-02-22 0.645 0.4450 0 -13.338 1 0.4510 0.674 0.744000 0.1510 0.1270 104.851 3 [Uli] [] [Uli] ['Uli'] Carve
1 021ht4sdgPcrDgSk7JTbKY Capítulo 2.16 - Banquero Anarquista 0 98200 0 ['Fernando Pessoa'] ['14jtPCOoNZwquk5wd9DxrY'] 1922-06-01 0.695 0.2630 0 -22.136 1 0.9570 0.797 0.000000 0.1480 0.6550 102.009 1 [Fernando Pessoa] [] [Fernando Pessoa] ['Fernando Pessoa'] Capítulo 2.16 - Banquero Anarquista
2 07A5yehtSnoedViJAZkNnc Vivo para Quererte - Remasterizado 0 181640 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.434 0.1770 1 -21.180 1 0.0512 0.994 0.021800 0.2120 0.4570 130.418 5 [Ignacio Corsini] [] [Ignacio Corsini] ['Ignacio Corsini'] Vivo para Quererte - Remasterizado
3 08FmqUhxtyLTn6pAh6bk45 El Prisionero - Remasterizado 0 176907 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.321 0.0946 7 -27.961 1 0.0504 0.995 0.918000 0.1040 0.3970 169.980 3 [Ignacio Corsini] [] [Ignacio Corsini] ['Ignacio Corsini'] El Prisionero - Remasterizado
4 08y9GfoqCWfOGsKdwojr5e Lady of the Evening 0 163080 0 ['Dick Haymes'] ['3BiJGZsyX9sJchTqcSA7Su'] 1922 0.402 0.1580 3 -16.900 0 0.0390 0.989 0.130000 0.3110 0.1960 103.220 4 [Dick Haymes] [] [Dick Haymes] ['Dick Haymes'] Lady of the Evening
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
586667 5rgu12WBIHQtvej2MdHSH0 云与海 50 258267 0 ['阿YueYue'] ['1QLBXKM5GCpyQQSVMNZqrZ'] 2020-09-26 0.560 0.5180 0 -7.471 0 0.0292 0.785 0.000000 0.0648 0.2110 131.896 4 [阿YueYue] [] [阿YueYue] ['阿YueYue'] 云与海
586668 0NuWgxEp51CutD2pJoF4OM blind 72 153293 0 ['ROLE MODEL'] ['1dy5WNgIKQU6ezkpZs4y8z'] 2020-10-21 0.765 0.6630 0 -5.223 1 0.0652 0.141 0.000297 0.0924 0.6860 150.091 4 [ROLE MODEL] [] [ROLE MODEL] ['ROLE MODEL'] blind
586669 27Y1N4Q4U3EfDU5Ubw8ws2 What They'll Say About Us 70 187601 0 ['FINNEAS'] ['37M5pPGs6V1fchFJSgCguX'] 2020-09-02 0.535 0.3140 7 -12.823 0 0.0408 0.895 0.000150 0.0874 0.0663 145.095 4 [FINNEAS] [] [FINNEAS] ['FINNEAS'] What They'll Say About Us
586670 45XJsGpFTyzbzeWK8VzR8S A Day At A Time 58 142003 0 ['Gentle Bones', 'Clara Benin'] ['4jGPdu95icCKVF31CcFKbS', '5ebPSE9YI5aLeZ1Z2g... 2021-03-05 0.696 0.6150 10 -6.212 1 0.0345 0.206 0.000003 0.3050 0.4380 90.029 4 [Gentle Bones, Clara Benin] [] [Gentle Bones, Clara Benin] ['Gentle Bones', 'Clara Benin'] A Day At A Time
586671 5Ocn6dZ3BJFPWh4ylwFXtn Mar de Emociones 38 214360 0 ['Afrosound'] ['0i4Qda0k4nf7jnNHmSNpYv'] 2015-07-01 0.686 0.7230 6 -7.067 1 0.0363 0.105 0.000000 0.2640 0.9750 112.204 4 [Afrosound] [] [Afrosound] ['Afrosound'] Mar de Emociones

586672 rows × 25 columns

In [ ]:
tracks_df['artists_song'] = tracks_df.apply(lambda row: row['artists_upd3']+row['names_strs'],axis = 1)
In [ ]:
tracks_df
Out[ ]:
id name popularity duration_ms explicit artists id_artists release_date danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo time_signature artists_upd_v1 artists_upd_v2 artists_upd artists_upd3 names_strs artists_song
0 35iwgR4jXetI318WEWsa1Q Carve 6 126903 0 ['Uli'] ['45tIt06XoI0Iio4LBEVpls'] 1922-02-22 0.645 0.4450 0 -13.338 1 0.4510 0.674 0.744000 0.1510 0.1270 104.851 3 [Uli] [] [Uli] ['Uli'] Carve ['Uli']Carve
1 021ht4sdgPcrDgSk7JTbKY Capítulo 2.16 - Banquero Anarquista 0 98200 0 ['Fernando Pessoa'] ['14jtPCOoNZwquk5wd9DxrY'] 1922-06-01 0.695 0.2630 0 -22.136 1 0.9570 0.797 0.000000 0.1480 0.6550 102.009 1 [Fernando Pessoa] [] [Fernando Pessoa] ['Fernando Pessoa'] Capítulo 2.16 - Banquero Anarquista ['Fernando Pessoa']Capítulo 2.16 - Banquero An...
2 07A5yehtSnoedViJAZkNnc Vivo para Quererte - Remasterizado 0 181640 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.434 0.1770 1 -21.180 1 0.0512 0.994 0.021800 0.2120 0.4570 130.418 5 [Ignacio Corsini] [] [Ignacio Corsini] ['Ignacio Corsini'] Vivo para Quererte - Remasterizado ['Ignacio Corsini']Vivo para Quererte - Remast...
3 08FmqUhxtyLTn6pAh6bk45 El Prisionero - Remasterizado 0 176907 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.321 0.0946 7 -27.961 1 0.0504 0.995 0.918000 0.1040 0.3970 169.980 3 [Ignacio Corsini] [] [Ignacio Corsini] ['Ignacio Corsini'] El Prisionero - Remasterizado ['Ignacio Corsini']El Prisionero - Remasterizado
4 08y9GfoqCWfOGsKdwojr5e Lady of the Evening 0 163080 0 ['Dick Haymes'] ['3BiJGZsyX9sJchTqcSA7Su'] 1922 0.402 0.1580 3 -16.900 0 0.0390 0.989 0.130000 0.3110 0.1960 103.220 4 [Dick Haymes] [] [Dick Haymes] ['Dick Haymes'] Lady of the Evening ['Dick Haymes']Lady of the Evening
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
586667 5rgu12WBIHQtvej2MdHSH0 云与海 50 258267 0 ['阿YueYue'] ['1QLBXKM5GCpyQQSVMNZqrZ'] 2020-09-26 0.560 0.5180 0 -7.471 0 0.0292 0.785 0.000000 0.0648 0.2110 131.896 4 [阿YueYue] [] [阿YueYue] ['阿YueYue'] 云与海 ['阿YueYue']云与海
586668 0NuWgxEp51CutD2pJoF4OM blind 72 153293 0 ['ROLE MODEL'] ['1dy5WNgIKQU6ezkpZs4y8z'] 2020-10-21 0.765 0.6630 0 -5.223 1 0.0652 0.141 0.000297 0.0924 0.6860 150.091 4 [ROLE MODEL] [] [ROLE MODEL] ['ROLE MODEL'] blind ['ROLE MODEL']blind
586669 27Y1N4Q4U3EfDU5Ubw8ws2 What They'll Say About Us 70 187601 0 ['FINNEAS'] ['37M5pPGs6V1fchFJSgCguX'] 2020-09-02 0.535 0.3140 7 -12.823 0 0.0408 0.895 0.000150 0.0874 0.0663 145.095 4 [FINNEAS] [] [FINNEAS] ['FINNEAS'] What They'll Say About Us ['FINNEAS']What They'll Say About Us
586670 45XJsGpFTyzbzeWK8VzR8S A Day At A Time 58 142003 0 ['Gentle Bones', 'Clara Benin'] ['4jGPdu95icCKVF31CcFKbS', '5ebPSE9YI5aLeZ1Z2g... 2021-03-05 0.696 0.6150 10 -6.212 1 0.0345 0.206 0.000003 0.3050 0.4380 90.029 4 [Gentle Bones, Clara Benin] [] [Gentle Bones, Clara Benin] ['Gentle Bones', 'Clara Benin'] A Day At A Time ['Gentle Bones', 'Clara Benin']A Day At A Time
586671 5Ocn6dZ3BJFPWh4ylwFXtn Mar de Emociones 38 214360 0 ['Afrosound'] ['0i4Qda0k4nf7jnNHmSNpYv'] 2015-07-01 0.686 0.7230 6 -7.067 1 0.0363 0.105 0.000000 0.2640 0.9750 112.204 4 [Afrosound] [] [Afrosound] ['Afrosound'] Mar de Emociones ['Afrosound']Mar de Emociones

586672 rows × 26 columns

Made new variable to identify all unique song name and artist names to prevent repeated songs¶

In [ ]:
tracks_df.drop_duplicates('artists_song',inplace = True)
In [ ]:
tracks_df
Out[ ]:
id name popularity duration_ms explicit artists id_artists release_date danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo time_signature artists_upd_v1 artists_upd_v2 artists_upd artists_upd3 names_strs artists_song
0 35iwgR4jXetI318WEWsa1Q Carve 6 126903 0 ['Uli'] ['45tIt06XoI0Iio4LBEVpls'] 1922-02-22 0.645 0.4450 0 -13.338 1 0.4510 0.674 0.744000 0.1510 0.1270 104.851 3 [Uli] [] [Uli] ['Uli'] Carve ['Uli']Carve
1 021ht4sdgPcrDgSk7JTbKY Capítulo 2.16 - Banquero Anarquista 0 98200 0 ['Fernando Pessoa'] ['14jtPCOoNZwquk5wd9DxrY'] 1922-06-01 0.695 0.2630 0 -22.136 1 0.9570 0.797 0.000000 0.1480 0.6550 102.009 1 [Fernando Pessoa] [] [Fernando Pessoa] ['Fernando Pessoa'] Capítulo 2.16 - Banquero Anarquista ['Fernando Pessoa']Capítulo 2.16 - Banquero An...
2 07A5yehtSnoedViJAZkNnc Vivo para Quererte - Remasterizado 0 181640 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.434 0.1770 1 -21.180 1 0.0512 0.994 0.021800 0.2120 0.4570 130.418 5 [Ignacio Corsini] [] [Ignacio Corsini] ['Ignacio Corsini'] Vivo para Quererte - Remasterizado ['Ignacio Corsini']Vivo para Quererte - Remast...
3 08FmqUhxtyLTn6pAh6bk45 El Prisionero - Remasterizado 0 176907 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.321 0.0946 7 -27.961 1 0.0504 0.995 0.918000 0.1040 0.3970 169.980 3 [Ignacio Corsini] [] [Ignacio Corsini] ['Ignacio Corsini'] El Prisionero - Remasterizado ['Ignacio Corsini']El Prisionero - Remasterizado
4 08y9GfoqCWfOGsKdwojr5e Lady of the Evening 0 163080 0 ['Dick Haymes'] ['3BiJGZsyX9sJchTqcSA7Su'] 1922 0.402 0.1580 3 -16.900 0 0.0390 0.989 0.130000 0.3110 0.1960 103.220 4 [Dick Haymes] [] [Dick Haymes] ['Dick Haymes'] Lady of the Evening ['Dick Haymes']Lady of the Evening
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
586667 5rgu12WBIHQtvej2MdHSH0 云与海 50 258267 0 ['阿YueYue'] ['1QLBXKM5GCpyQQSVMNZqrZ'] 2020-09-26 0.560 0.5180 0 -7.471 0 0.0292 0.785 0.000000 0.0648 0.2110 131.896 4 [阿YueYue] [] [阿YueYue] ['阿YueYue'] 云与海 ['阿YueYue']云与海
586668 0NuWgxEp51CutD2pJoF4OM blind 72 153293 0 ['ROLE MODEL'] ['1dy5WNgIKQU6ezkpZs4y8z'] 2020-10-21 0.765 0.6630 0 -5.223 1 0.0652 0.141 0.000297 0.0924 0.6860 150.091 4 [ROLE MODEL] [] [ROLE MODEL] ['ROLE MODEL'] blind ['ROLE MODEL']blind
586669 27Y1N4Q4U3EfDU5Ubw8ws2 What They'll Say About Us 70 187601 0 ['FINNEAS'] ['37M5pPGs6V1fchFJSgCguX'] 2020-09-02 0.535 0.3140 7 -12.823 0 0.0408 0.895 0.000150 0.0874 0.0663 145.095 4 [FINNEAS] [] [FINNEAS] ['FINNEAS'] What They'll Say About Us ['FINNEAS']What They'll Say About Us
586670 45XJsGpFTyzbzeWK8VzR8S A Day At A Time 58 142003 0 ['Gentle Bones', 'Clara Benin'] ['4jGPdu95icCKVF31CcFKbS', '5ebPSE9YI5aLeZ1Z2g... 2021-03-05 0.696 0.6150 10 -6.212 1 0.0345 0.206 0.000003 0.3050 0.4380 90.029 4 [Gentle Bones, Clara Benin] [] [Gentle Bones, Clara Benin] ['Gentle Bones', 'Clara Benin'] A Day At A Time ['Gentle Bones', 'Clara Benin']A Day At A Time
586671 5Ocn6dZ3BJFPWh4ylwFXtn Mar de Emociones 38 214360 0 ['Afrosound'] ['0i4Qda0k4nf7jnNHmSNpYv'] 2015-07-01 0.686 0.7230 6 -7.067 1 0.0363 0.105 0.000000 0.2640 0.9750 112.204 4 [Afrosound] [] [Afrosound] ['Afrosound'] Mar de Emociones ['Afrosound']Mar de Emociones

526595 rows × 26 columns

In [ ]:
artists_exploded = tracks_df[['artists_upd','id']].explode('artists_upd')
In [ ]:
artists_exploded
Out[ ]:
artists_upd id
0 Uli 35iwgR4jXetI318WEWsa1Q
1 Fernando Pessoa 021ht4sdgPcrDgSk7JTbKY
2 Ignacio Corsini 07A5yehtSnoedViJAZkNnc
3 Ignacio Corsini 08FmqUhxtyLTn6pAh6bk45
4 Dick Haymes 08y9GfoqCWfOGsKdwojr5e
... ... ...
586668 ROLE MODEL 0NuWgxEp51CutD2pJoF4OM
586669 FINNEAS 27Y1N4Q4U3EfDU5Ubw8ws2
586670 Gentle Bones 45XJsGpFTyzbzeWK8VzR8S
586670 Clara Benin 45XJsGpFTyzbzeWK8VzR8S
586671 Afrosound 5Ocn6dZ3BJFPWh4ylwFXtn

681407 rows × 2 columns

modifications: alterations in data normalization¶

In [ ]:
artists_exploded_enriched = artists_exploded.merge(genres_df, how = 'left', left_on = 'id',right_on = 'id')
In [ ]:
artists_exploded_enriched
Out[ ]:
artists_upd id danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo type uri track_href analysis_url duration_ms time_signature genre song_name Unnamed: 0 title
0 Uli 35iwgR4jXetI318WEWsa1Q NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
1 Fernando Pessoa 021ht4sdgPcrDgSk7JTbKY NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
2 Ignacio Corsini 07A5yehtSnoedViJAZkNnc NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
3 Ignacio Corsini 08FmqUhxtyLTn6pAh6bk45 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
4 Dick Haymes 08y9GfoqCWfOGsKdwojr5e NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
683355 ROLE MODEL 0NuWgxEp51CutD2pJoF4OM NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
683356 FINNEAS 27Y1N4Q4U3EfDU5Ubw8ws2 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
683357 Gentle Bones 45XJsGpFTyzbzeWK8VzR8S NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
683358 Clara Benin 45XJsGpFTyzbzeWK8VzR8S NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
683359 Afrosound 5Ocn6dZ3BJFPWh4ylwFXtn NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN

683360 rows × 23 columns

In [ ]:
artists_exploded_enriched_nonnull = artists_exploded_enriched[~artists_exploded_enriched.genre.isnull()]
In [ ]:
artists_exploded_enriched_nonnull
Out[ ]:
artists_upd id danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo type uri track_href analysis_url duration_ms time_signature genre song_name Unnamed: 0 title
52733 Johnny Cash 6YffUZJ2R06kyxyK6onezL 0.659 0.585 7.0 -8.189 1.0 0.0288 0.623000 0.000213 0.3480 0.784 208.222 audio_features spotify:track:6YffUZJ2R06kyxyK6onezL https://api.spotify.com/v1/tracks/6YffUZJ2R06k... https://api.spotify.com/v1/audio-analysis/6Yff... 158427.0 4.0 RnB Ring of Fire NaN NaN
57144 Jimi Hendrix 0wJoRiX5K5BxlqZTolB2LD 0.533 0.905 2.0 -5.270 1.0 0.0754 0.008760 0.578000 0.0698 0.486 108.900 audio_features spotify:track:0wJoRiX5K5BxlqZTolB2LD https://api.spotify.com/v1/tracks/0wJoRiX5K5Bx... https://api.spotify.com/v1/audio-analysis/0wJo... 170813.0 4.0 Hiphop Purple Haze NaN NaN
58218 Jimi Hendrix 2aoo2jlRnM3A0NyLQqMN2f 0.438 0.805 8.0 -6.237 1.0 0.0624 0.002550 0.000057 0.0842 0.564 113.253 audio_features spotify:track:2aoo2jlRnM3A0NyLQqMN2f https://api.spotify.com/v1/tracks/2aoo2jlRnM3A... https://api.spotify.com/v1/audio-analysis/2aoo... 240800.0 4.0 Underground Rap All Along the Watchtower NaN NaN
62397 Al Green 63xdwScd1Ai1GigAwQxE8y 0.756 0.397 7.0 -10.701 0.0 0.0522 0.570000 0.011500 0.0542 0.507 203.970 audio_features spotify:track:63xdwScd1Ai1GigAwQxE8y https://api.spotify.com/v1/tracks/63xdwScd1Ai1... https://api.spotify.com/v1/audio-analysis/63xd... 199396.0 4.0 Hiphop Let's Stay Together NaN NaN
63422 Aerosmith 5MxNLUsfh7uzROypsoO5qe 0.307 0.433 1.0 -10.057 1.0 0.0290 0.388000 0.000091 0.3320 0.224 160.900 audio_features spotify:track:5MxNLUsfh7uzROypsoO5qe https://api.spotify.com/v1/tracks/5MxNLUsfh7uz... https://api.spotify.com/v1/audio-analysis/5MxN... 266960.0 4.0 Emo Dream On NaN NaN
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
670122 JoJo 3hc7PLcmuZbJGPjhIore1i 0.394 0.821 6.0 -4.304 0.0 0.0404 0.003020 0.019000 0.1860 0.509 165.528 audio_features spotify:track:3hc7PLcmuZbJGPjhIore1i https://api.spotify.com/v1/tracks/3hc7PLcmuZbJ... https://api.spotify.com/v1/audio-analysis/3hc7... 223533.0 4.0 RnB Too Little Too Late - 2018 NaN NaN
670146 Simple Plan 1B8MHa0NveCF1ViBEOZWO5 0.522 0.751 1.0 -5.460 1.0 0.0435 0.000491 0.000002 0.1580 0.605 139.510 audio_features spotify:track:1B8MHa0NveCF1ViBEOZWO5 https://api.spotify.com/v1/tracks/1B8MHa0NveCF... https://api.spotify.com/v1/audio-analysis/1B8M... 232067.0 3.0 Emo Addicted NaN NaN
670339 Ariana Grande 2vdBo4ALPYbHRUPKgtE5iC 0.287 0.364 9.0 -8.295 1.0 0.0306 0.418000 0.000018 0.1850 0.110 207.554 audio_features spotify:track:2vdBo4ALPYbHRUPKgtE5iC https://api.spotify.com/v1/tracks/2vdBo4ALPYbH... https://api.spotify.com/v1/audio-analysis/2vdB... 271467.0 4.0 RnB ghostin NaN NaN
670561 Puddle Of Mudd 7Ml1vXT6LaH34jVBGYygWY 0.406 0.932 6.0 -3.386 0.0 0.0936 0.000061 0.000000 0.0530 0.290 130.084 audio_features spotify:track:7Ml1vXT6LaH34jVBGYygWY https://api.spotify.com/v1/tracks/7Ml1vXT6LaH3... https://api.spotify.com/v1/audio-analysis/7Ml1... 196293.0 4.0 Emo Famous NaN NaN
670571 Kendrick Lamar 0y9uTzK9cNKSAEHnpeRG8C 0.552 0.731 7.0 -6.873 1.0 0.6150 0.053600 0.000000 0.2580 0.632 174.516 audio_features spotify:track:0y9uTzK9cNKSAEHnpeRG8C https://api.spotify.com/v1/tracks/0y9uTzK9cNKS... https://api.spotify.com/v1/audio-analysis/0y9u... 248613.0 4.0 Rap DUCKWORTH. NaN NaN

7278 rows × 23 columns

In [ ]:
artists_genres_consolidated = artists_exploded_enriched_nonnull.groupby('id')['genre'].apply(list).reset_index()
In [ ]:
artists_genres_consolidated.head()
Out[ ]:
id genre
0 003FTlCpBTM4eSqYSWPv4H [Emo]
1 00FROhC5g4iJdax5US8jRr [Hiphop]
2 00GOPLxW4PGQuUYdPJh8K1 [Hiphop]
3 00Mb3DuaIH1kjrwOku9CGU [Emo]
4 00NAQYOP4AmWR549nnYJZu [RnB]
In [ ]:
tracks_df = tracks_df.merge(artists_genres_consolidated, on = 'id',how = 'left')
In [ ]:
tracks_df
#=tracks_df.drop(['genre_y','genre_x'],axis=1)
Out[ ]:
id name popularity duration_ms explicit artists id_artists release_date danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo time_signature artists_upd_v1 artists_upd_v2 artists_upd artists_upd3 names_strs artists_song genre
0 35iwgR4jXetI318WEWsa1Q Carve 6 126903 0 ['Uli'] ['45tIt06XoI0Iio4LBEVpls'] 1922-02-22 0.645 0.4450 0 -13.338 1 0.4510 0.674 0.744000 0.1510 0.1270 104.851 3 [Uli] [] [Uli] ['Uli'] Carve ['Uli']Carve NaN
1 021ht4sdgPcrDgSk7JTbKY Capítulo 2.16 - Banquero Anarquista 0 98200 0 ['Fernando Pessoa'] ['14jtPCOoNZwquk5wd9DxrY'] 1922-06-01 0.695 0.2630 0 -22.136 1 0.9570 0.797 0.000000 0.1480 0.6550 102.009 1 [Fernando Pessoa] [] [Fernando Pessoa] ['Fernando Pessoa'] Capítulo 2.16 - Banquero Anarquista ['Fernando Pessoa']Capítulo 2.16 - Banquero An... NaN
2 07A5yehtSnoedViJAZkNnc Vivo para Quererte - Remasterizado 0 181640 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.434 0.1770 1 -21.180 1 0.0512 0.994 0.021800 0.2120 0.4570 130.418 5 [Ignacio Corsini] [] [Ignacio Corsini] ['Ignacio Corsini'] Vivo para Quererte - Remasterizado ['Ignacio Corsini']Vivo para Quererte - Remast... NaN
3 08FmqUhxtyLTn6pAh6bk45 El Prisionero - Remasterizado 0 176907 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.321 0.0946 7 -27.961 1 0.0504 0.995 0.918000 0.1040 0.3970 169.980 3 [Ignacio Corsini] [] [Ignacio Corsini] ['Ignacio Corsini'] El Prisionero - Remasterizado ['Ignacio Corsini']El Prisionero - Remasterizado NaN
4 08y9GfoqCWfOGsKdwojr5e Lady of the Evening 0 163080 0 ['Dick Haymes'] ['3BiJGZsyX9sJchTqcSA7Su'] 1922 0.402 0.1580 3 -16.900 0 0.0390 0.989 0.130000 0.3110 0.1960 103.220 4 [Dick Haymes] [] [Dick Haymes] ['Dick Haymes'] Lady of the Evening ['Dick Haymes']Lady of the Evening NaN
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
526590 5rgu12WBIHQtvej2MdHSH0 云与海 50 258267 0 ['阿YueYue'] ['1QLBXKM5GCpyQQSVMNZqrZ'] 2020-09-26 0.560 0.5180 0 -7.471 0 0.0292 0.785 0.000000 0.0648 0.2110 131.896 4 [阿YueYue] [] [阿YueYue] ['阿YueYue'] 云与海 ['阿YueYue']云与海 NaN
526591 0NuWgxEp51CutD2pJoF4OM blind 72 153293 0 ['ROLE MODEL'] ['1dy5WNgIKQU6ezkpZs4y8z'] 2020-10-21 0.765 0.6630 0 -5.223 1 0.0652 0.141 0.000297 0.0924 0.6860 150.091 4 [ROLE MODEL] [] [ROLE MODEL] ['ROLE MODEL'] blind ['ROLE MODEL']blind NaN
526592 27Y1N4Q4U3EfDU5Ubw8ws2 What They'll Say About Us 70 187601 0 ['FINNEAS'] ['37M5pPGs6V1fchFJSgCguX'] 2020-09-02 0.535 0.3140 7 -12.823 0 0.0408 0.895 0.000150 0.0874 0.0663 145.095 4 [FINNEAS] [] [FINNEAS] ['FINNEAS'] What They'll Say About Us ['FINNEAS']What They'll Say About Us NaN
526593 45XJsGpFTyzbzeWK8VzR8S A Day At A Time 58 142003 0 ['Gentle Bones', 'Clara Benin'] ['4jGPdu95icCKVF31CcFKbS', '5ebPSE9YI5aLeZ1Z2g... 2021-03-05 0.696 0.6150 10 -6.212 1 0.0345 0.206 0.000003 0.3050 0.4380 90.029 4 [Gentle Bones, Clara Benin] [] [Gentle Bones, Clara Benin] ['Gentle Bones', 'Clara Benin'] A Day At A Time ['Gentle Bones', 'Clara Benin']A Day At A Time NaN
526594 5Ocn6dZ3BJFPWh4ylwFXtn Mar de Emociones 38 214360 0 ['Afrosound'] ['0i4Qda0k4nf7jnNHmSNpYv'] 2015-07-01 0.686 0.7230 6 -7.067 1 0.0363 0.105 0.000000 0.2640 0.9750 112.204 4 [Afrosound] [] [Afrosound] ['Afrosound'] Mar de Emociones ['Afrosound']Mar de Emociones NaN

526595 rows × 27 columns

In [ ]:
tracks_df
Out[ ]:
id name popularity duration_ms explicit artists id_artists release_date danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo time_signature artists_upd_v1 artists_upd_v2 artists_upd artists_upd3 names_strs artists_song genre
0 35iwgR4jXetI318WEWsa1Q Carve 6 126903 0 ['Uli'] ['45tIt06XoI0Iio4LBEVpls'] 1922-02-22 0.645 0.4450 0 -13.338 1 0.4510 0.674 0.744000 0.1510 0.1270 104.851 3 [Uli] [] [Uli] ['Uli'] Carve ['Uli']Carve NaN
1 021ht4sdgPcrDgSk7JTbKY Capítulo 2.16 - Banquero Anarquista 0 98200 0 ['Fernando Pessoa'] ['14jtPCOoNZwquk5wd9DxrY'] 1922-06-01 0.695 0.2630 0 -22.136 1 0.9570 0.797 0.000000 0.1480 0.6550 102.009 1 [Fernando Pessoa] [] [Fernando Pessoa] ['Fernando Pessoa'] Capítulo 2.16 - Banquero Anarquista ['Fernando Pessoa']Capítulo 2.16 - Banquero An... NaN
2 07A5yehtSnoedViJAZkNnc Vivo para Quererte - Remasterizado 0 181640 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.434 0.1770 1 -21.180 1 0.0512 0.994 0.021800 0.2120 0.4570 130.418 5 [Ignacio Corsini] [] [Ignacio Corsini] ['Ignacio Corsini'] Vivo para Quererte - Remasterizado ['Ignacio Corsini']Vivo para Quererte - Remast... NaN
3 08FmqUhxtyLTn6pAh6bk45 El Prisionero - Remasterizado 0 176907 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.321 0.0946 7 -27.961 1 0.0504 0.995 0.918000 0.1040 0.3970 169.980 3 [Ignacio Corsini] [] [Ignacio Corsini] ['Ignacio Corsini'] El Prisionero - Remasterizado ['Ignacio Corsini']El Prisionero - Remasterizado NaN
4 08y9GfoqCWfOGsKdwojr5e Lady of the Evening 0 163080 0 ['Dick Haymes'] ['3BiJGZsyX9sJchTqcSA7Su'] 1922 0.402 0.1580 3 -16.900 0 0.0390 0.989 0.130000 0.3110 0.1960 103.220 4 [Dick Haymes] [] [Dick Haymes] ['Dick Haymes'] Lady of the Evening ['Dick Haymes']Lady of the Evening NaN
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
526590 5rgu12WBIHQtvej2MdHSH0 云与海 50 258267 0 ['阿YueYue'] ['1QLBXKM5GCpyQQSVMNZqrZ'] 2020-09-26 0.560 0.5180 0 -7.471 0 0.0292 0.785 0.000000 0.0648 0.2110 131.896 4 [阿YueYue] [] [阿YueYue] ['阿YueYue'] 云与海 ['阿YueYue']云与海 NaN
526591 0NuWgxEp51CutD2pJoF4OM blind 72 153293 0 ['ROLE MODEL'] ['1dy5WNgIKQU6ezkpZs4y8z'] 2020-10-21 0.765 0.6630 0 -5.223 1 0.0652 0.141 0.000297 0.0924 0.6860 150.091 4 [ROLE MODEL] [] [ROLE MODEL] ['ROLE MODEL'] blind ['ROLE MODEL']blind NaN
526592 27Y1N4Q4U3EfDU5Ubw8ws2 What They'll Say About Us 70 187601 0 ['FINNEAS'] ['37M5pPGs6V1fchFJSgCguX'] 2020-09-02 0.535 0.3140 7 -12.823 0 0.0408 0.895 0.000150 0.0874 0.0663 145.095 4 [FINNEAS] [] [FINNEAS] ['FINNEAS'] What They'll Say About Us ['FINNEAS']What They'll Say About Us NaN
526593 45XJsGpFTyzbzeWK8VzR8S A Day At A Time 58 142003 0 ['Gentle Bones', 'Clara Benin'] ['4jGPdu95icCKVF31CcFKbS', '5ebPSE9YI5aLeZ1Z2g... 2021-03-05 0.696 0.6150 10 -6.212 1 0.0345 0.206 0.000003 0.3050 0.4380 90.029 4 [Gentle Bones, Clara Benin] [] [Gentle Bones, Clara Benin] ['Gentle Bones', 'Clara Benin'] A Day At A Time ['Gentle Bones', 'Clara Benin']A Day At A Time NaN
526594 5Ocn6dZ3BJFPWh4ylwFXtn Mar de Emociones 38 214360 0 ['Afrosound'] ['0i4Qda0k4nf7jnNHmSNpYv'] 2015-07-01 0.686 0.7230 6 -7.067 1 0.0363 0.105 0.000000 0.2640 0.9750 112.204 4 [Afrosound] [] [Afrosound] ['Afrosound'] Mar de Emociones ['Afrosound']Mar de Emociones NaN

526595 rows × 27 columns

In [ ]:
tracks_df['year'] = tracks_df['release_date'].apply(lambda x: x.split('-')[0])
In [ ]:
tracks_df
Out[ ]:
id name popularity duration_ms explicit artists id_artists release_date danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo time_signature artists_upd_v1 artists_upd_v2 artists_upd artists_upd3 names_strs artists_song genre year
0 35iwgR4jXetI318WEWsa1Q Carve 6 126903 0 ['Uli'] ['45tIt06XoI0Iio4LBEVpls'] 1922-02-22 0.645 0.4450 0 -13.338 1 0.4510 0.674 0.744000 0.1510 0.1270 104.851 3 [Uli] [] [Uli] ['Uli'] Carve ['Uli']Carve NaN 1922
1 021ht4sdgPcrDgSk7JTbKY Capítulo 2.16 - Banquero Anarquista 0 98200 0 ['Fernando Pessoa'] ['14jtPCOoNZwquk5wd9DxrY'] 1922-06-01 0.695 0.2630 0 -22.136 1 0.9570 0.797 0.000000 0.1480 0.6550 102.009 1 [Fernando Pessoa] [] [Fernando Pessoa] ['Fernando Pessoa'] Capítulo 2.16 - Banquero Anarquista ['Fernando Pessoa']Capítulo 2.16 - Banquero An... NaN 1922
2 07A5yehtSnoedViJAZkNnc Vivo para Quererte - Remasterizado 0 181640 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.434 0.1770 1 -21.180 1 0.0512 0.994 0.021800 0.2120 0.4570 130.418 5 [Ignacio Corsini] [] [Ignacio Corsini] ['Ignacio Corsini'] Vivo para Quererte - Remasterizado ['Ignacio Corsini']Vivo para Quererte - Remast... NaN 1922
3 08FmqUhxtyLTn6pAh6bk45 El Prisionero - Remasterizado 0 176907 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.321 0.0946 7 -27.961 1 0.0504 0.995 0.918000 0.1040 0.3970 169.980 3 [Ignacio Corsini] [] [Ignacio Corsini] ['Ignacio Corsini'] El Prisionero - Remasterizado ['Ignacio Corsini']El Prisionero - Remasterizado NaN 1922
4 08y9GfoqCWfOGsKdwojr5e Lady of the Evening 0 163080 0 ['Dick Haymes'] ['3BiJGZsyX9sJchTqcSA7Su'] 1922 0.402 0.1580 3 -16.900 0 0.0390 0.989 0.130000 0.3110 0.1960 103.220 4 [Dick Haymes] [] [Dick Haymes] ['Dick Haymes'] Lady of the Evening ['Dick Haymes']Lady of the Evening NaN 1922
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
526590 5rgu12WBIHQtvej2MdHSH0 云与海 50 258267 0 ['阿YueYue'] ['1QLBXKM5GCpyQQSVMNZqrZ'] 2020-09-26 0.560 0.5180 0 -7.471 0 0.0292 0.785 0.000000 0.0648 0.2110 131.896 4 [阿YueYue] [] [阿YueYue] ['阿YueYue'] 云与海 ['阿YueYue']云与海 NaN 2020
526591 0NuWgxEp51CutD2pJoF4OM blind 72 153293 0 ['ROLE MODEL'] ['1dy5WNgIKQU6ezkpZs4y8z'] 2020-10-21 0.765 0.6630 0 -5.223 1 0.0652 0.141 0.000297 0.0924 0.6860 150.091 4 [ROLE MODEL] [] [ROLE MODEL] ['ROLE MODEL'] blind ['ROLE MODEL']blind NaN 2020
526592 27Y1N4Q4U3EfDU5Ubw8ws2 What They'll Say About Us 70 187601 0 ['FINNEAS'] ['37M5pPGs6V1fchFJSgCguX'] 2020-09-02 0.535 0.3140 7 -12.823 0 0.0408 0.895 0.000150 0.0874 0.0663 145.095 4 [FINNEAS] [] [FINNEAS] ['FINNEAS'] What They'll Say About Us ['FINNEAS']What They'll Say About Us NaN 2020
526593 45XJsGpFTyzbzeWK8VzR8S A Day At A Time 58 142003 0 ['Gentle Bones', 'Clara Benin'] ['4jGPdu95icCKVF31CcFKbS', '5ebPSE9YI5aLeZ1Z2g... 2021-03-05 0.696 0.6150 10 -6.212 1 0.0345 0.206 0.000003 0.3050 0.4380 90.029 4 [Gentle Bones, Clara Benin] [] [Gentle Bones, Clara Benin] ['Gentle Bones', 'Clara Benin'] A Day At A Time ['Gentle Bones', 'Clara Benin']A Day At A Time NaN 2021
526594 5Ocn6dZ3BJFPWh4ylwFXtn Mar de Emociones 38 214360 0 ['Afrosound'] ['0i4Qda0k4nf7jnNHmSNpYv'] 2015-07-01 0.686 0.7230 6 -7.067 1 0.0363 0.105 0.000000 0.2640 0.9750 112.204 4 [Afrosound] [] [Afrosound] ['Afrosound'] Mar de Emociones ['Afrosound']Mar de Emociones NaN 2015

526595 rows × 28 columns

In [ ]:
float_cols = tracks_df.dtypes[tracks_df.dtypes == 'float64'].index.values
In [ ]:
ohe_cols = 'popularity'
In [ ]:
# rank with 5 buckets to normalize data
tracks_df['popularity_red'] = tracks_df['popularity'].apply(lambda x: int(x/5))
In [ ]:
tracks_df['genre'] = tracks_df['genre'].apply(lambda d: d if isinstance(d, list) else [])
In [ ]:
tracks_df
Out[ ]:
id name popularity duration_ms explicit artists id_artists release_date danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo time_signature artists_upd_v1 artists_upd_v2 artists_upd artists_upd3 names_strs artists_song genre year popularity_red
0 35iwgR4jXetI318WEWsa1Q Carve 6 126903 0 ['Uli'] ['45tIt06XoI0Iio4LBEVpls'] 1922-02-22 0.645 0.4450 0 -13.338 1 0.4510 0.674 0.744000 0.1510 0.1270 104.851 3 [Uli] [] [Uli] ['Uli'] Carve ['Uli']Carve [] 1922 1
1 021ht4sdgPcrDgSk7JTbKY Capítulo 2.16 - Banquero Anarquista 0 98200 0 ['Fernando Pessoa'] ['14jtPCOoNZwquk5wd9DxrY'] 1922-06-01 0.695 0.2630 0 -22.136 1 0.9570 0.797 0.000000 0.1480 0.6550 102.009 1 [Fernando Pessoa] [] [Fernando Pessoa] ['Fernando Pessoa'] Capítulo 2.16 - Banquero Anarquista ['Fernando Pessoa']Capítulo 2.16 - Banquero An... [] 1922 0
2 07A5yehtSnoedViJAZkNnc Vivo para Quererte - Remasterizado 0 181640 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.434 0.1770 1 -21.180 1 0.0512 0.994 0.021800 0.2120 0.4570 130.418 5 [Ignacio Corsini] [] [Ignacio Corsini] ['Ignacio Corsini'] Vivo para Quererte - Remasterizado ['Ignacio Corsini']Vivo para Quererte - Remast... [] 1922 0
3 08FmqUhxtyLTn6pAh6bk45 El Prisionero - Remasterizado 0 176907 0 ['Ignacio Corsini'] ['5LiOoJbxVSAMkBS2fUm3X2'] 1922-03-21 0.321 0.0946 7 -27.961 1 0.0504 0.995 0.918000 0.1040 0.3970 169.980 3 [Ignacio Corsini] [] [Ignacio Corsini] ['Ignacio Corsini'] El Prisionero - Remasterizado ['Ignacio Corsini']El Prisionero - Remasterizado [] 1922 0
4 08y9GfoqCWfOGsKdwojr5e Lady of the Evening 0 163080 0 ['Dick Haymes'] ['3BiJGZsyX9sJchTqcSA7Su'] 1922 0.402 0.1580 3 -16.900 0 0.0390 0.989 0.130000 0.3110 0.1960 103.220 4 [Dick Haymes] [] [Dick Haymes] ['Dick Haymes'] Lady of the Evening ['Dick Haymes']Lady of the Evening [] 1922 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
526590 5rgu12WBIHQtvej2MdHSH0 云与海 50 258267 0 ['阿YueYue'] ['1QLBXKM5GCpyQQSVMNZqrZ'] 2020-09-26 0.560 0.5180 0 -7.471 0 0.0292 0.785 0.000000 0.0648 0.2110 131.896 4 [阿YueYue] [] [阿YueYue] ['阿YueYue'] 云与海 ['阿YueYue']云与海 [] 2020 10
526591 0NuWgxEp51CutD2pJoF4OM blind 72 153293 0 ['ROLE MODEL'] ['1dy5WNgIKQU6ezkpZs4y8z'] 2020-10-21 0.765 0.6630 0 -5.223 1 0.0652 0.141 0.000297 0.0924 0.6860 150.091 4 [ROLE MODEL] [] [ROLE MODEL] ['ROLE MODEL'] blind ['ROLE MODEL']blind [] 2020 14
526592 27Y1N4Q4U3EfDU5Ubw8ws2 What They'll Say About Us 70 187601 0 ['FINNEAS'] ['37M5pPGs6V1fchFJSgCguX'] 2020-09-02 0.535 0.3140 7 -12.823 0 0.0408 0.895 0.000150 0.0874 0.0663 145.095 4 [FINNEAS] [] [FINNEAS] ['FINNEAS'] What They'll Say About Us ['FINNEAS']What They'll Say About Us [] 2020 14
526593 45XJsGpFTyzbzeWK8VzR8S A Day At A Time 58 142003 0 ['Gentle Bones', 'Clara Benin'] ['4jGPdu95icCKVF31CcFKbS', '5ebPSE9YI5aLeZ1Z2g... 2021-03-05 0.696 0.6150 10 -6.212 1 0.0345 0.206 0.000003 0.3050 0.4380 90.029 4 [Gentle Bones, Clara Benin] [] [Gentle Bones, Clara Benin] ['Gentle Bones', 'Clara Benin'] A Day At A Time ['Gentle Bones', 'Clara Benin']A Day At A Time [] 2021 11
526594 5Ocn6dZ3BJFPWh4ylwFXtn Mar de Emociones 38 214360 0 ['Afrosound'] ['0i4Qda0k4nf7jnNHmSNpYv'] 2015-07-01 0.686 0.7230 6 -7.067 1 0.0363 0.105 0.000000 0.2640 0.9750 112.204 4 [Afrosound] [] [Afrosound] ['Afrosound'] Mar de Emociones ['Afrosound']Mar de Emociones [] 2015 7

526595 rows × 29 columns

In [ ]:
def ohe_prep(df, column, new_name):


    tf_df = pd.get_dummies(df[column])
    feature_names = tf_df.columns
    tf_df.columns = [new_name + "|" + str(i) for i in feature_names]
    tf_df.reset_index(drop = True, inplace = True)
    return tf_df
In [ ]:
#function to build entire feature set
def create_feature_set(df, float_cols):


    #tfidf genre lists
    tfidf = TfidfVectorizer()
    tfidf_matrix =  tfidf.fit_transform(df['genre'].apply(lambda x: " ".join(x)))
    genre_df = pd.DataFrame(tfidf_matrix.toarray())
    genre_df.columns = ['genre' + "|" + i for i in tfidf.get_feature_names()]
    genre_df.reset_index(drop = True, inplace=True)

    #explicity_ohe = ohe_prep(df, 'explicit','exp')    
    year_ohe = ohe_prep(df, 'year','year') * 0.5
    popularity_ohe = ohe_prep(df, 'popularity_red','pop') * 0.15

    #scale float columns
    floats = df[float_cols].reset_index(drop = True)
    scaler = MinMaxScaler()
    floats_scaled = pd.DataFrame(scaler.fit_transform(floats), columns = floats.columns) * 0.2

    #concanenate all features
    final = pd.concat([genre_df, floats_scaled, popularity_ohe, year_ohe], axis = 1)

    #add song id
    final['id']=df['id'].values

    return final
In [ ]:
complete_feature_set = create_feature_set(tracks_df, float_cols=float_cols)#.mean(axis = 0)
In [ ]:
complete_feature_set.head()
Out[ ]:
genre|dark genre|dnb genre|emo genre|hardstyle genre|hiphop genre|metal genre|pop genre|psytrance genre|rap genre|rnb genre|techhouse genre|techno genre|trance genre|trap genre|underground danceability energy loudness speechiness acousticness instrumentalness liveness valence tempo pop|0 pop|1 pop|2 pop|3 pop|4 pop|5 pop|6 pop|7 pop|8 pop|9 pop|10 pop|11 pop|12 pop|13 pop|14 pop|15 pop|16 pop|17 pop|18 pop|19 pop|20 year|1900 year|1922 year|1923 year|1924 year|1925 year|1926 year|1927 year|1928 year|1929 year|1930 year|1931 year|1932 year|1933 year|1934 year|1935 year|1936 year|1937 year|1938 year|1939 year|1940 year|1941 year|1942 year|1943 year|1944 year|1945 year|1946 year|1947 year|1948 year|1949 year|1950 year|1951 year|1952 year|1953 year|1954 year|1955 year|1956 year|1957 year|1958 year|1959 year|1960 year|1961 year|1962 year|1963 year|1964 year|1965 year|1966 year|1967 year|1968 year|1969 year|1970 year|1971 year|1972 year|1973 year|1974 year|1975 year|1976 year|1977 year|1978 year|1979 year|1980 year|1981 year|1982 year|1983 year|1984 year|1985 year|1986 year|1987 year|1988 year|1989 year|1990 year|1991 year|1992 year|1993 year|1994 year|1995 year|1996 year|1997 year|1998 year|1999 year|2000 year|2001 year|2002 year|2003 year|2004 year|2005 year|2006 year|2007 year|2008 year|2009 year|2010 year|2011 year|2012 year|2013 year|2014 year|2015 year|2016 year|2017 year|2018 year|2019 year|2020 year|2021 id
0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.130172 0.08900 0.142750 0.092894 0.135341 0.14880 0.0302 0.0254 0.085113 0.00 0.15 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.5 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 35iwgR4jXetI318WEWsa1Q
1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.140262 0.05260 0.115835 0.197116 0.160040 0.00000 0.0296 0.1310 0.082806 0.15 0.00 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.5 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 021ht4sdgPcrDgSk7JTbKY
2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.087588 0.03540 0.118759 0.010546 0.199598 0.00436 0.0424 0.0914 0.105867 0.15 0.00 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.5 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 07A5yehtSnoedViJAZkNnc
3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.064783 0.01892 0.098015 0.010381 0.199799 0.18360 0.0208 0.0794 0.137981 0.15 0.00 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.5 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 08FmqUhxtyLTn6pAh6bk45
4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.081130 0.03160 0.131853 0.008033 0.198594 0.02600 0.0622 0.0392 0.083789 0.15 0.00 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.5 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 08y9GfoqCWfOGsKdwojr5e

Connection to Spotify API¶

In [ ]:
#client id and secret for my application
client_id = id
client_secret= id
In [ ]:
scope = 'user-library-read'

if len(sys.argv) > 1:
    username = sys.argv[1]
else:
    print("Usage: %s username" % (sys.argv[0],))
    sys.exit()
In [ ]:
auth_manager = SpotifyClientCredentials(client_id=client_id, client_secret=client_secret)
sp = spotipy.Spotify(auth_manager=auth_manager)
In [ ]:
token = util.prompt_for_user_token(scope, client_id= client_id, client_secret=client_secret, redirect_uri='http://localhost:8834/')
In [ ]:
sp = spotipy.Spotify(auth=token)
In [ ]:
#gather playlist names and images- probably won't use images

id_name = {}
list_photo = {}
for i in sp.current_user_playlists()['items']:

    id_name[i['name']] = i['uri'].split(':')[2]
    list_photo[i['uri'].split(':')[2]] = i['images'][0]['url']
In [ ]:
id_name
Out[ ]:
{'stop being mentally ill 😃': '1Ax0ss6gBDTy0EEX3XwuHz',
 'white woman victim mentalility': '0CqBqQDeemcY1uPno55gw3',
 'testing 123': '1kPx9eumti8hVG0SRfI68r',
 'it’s giving pregame ': '06uH5504qeZ9S1t8Yi98Re',
 "god's favorites": '34JjmLf1swnMZQdbGi1YqY',
 'r u from new york even ': '3NHuIVmGx1rprbzvAcxFZf',
 'tummy ache ': '5PTiaF2o9zptowGbU6SqhV',
 'march-ish': '7cEfzMNky6frWSZYPlMjII',
 'yer ': '7v9rp09s1WOdni2lWetiRv',
 'sleep': '1WED6iXU4UHvKKm2l2CnRI',
 'die for my bitch!!!!!!!!': '5S9fYTKASPBddrjIBi7XS2',
 'chilxz': '3vQlFH3Tw5RPsxvIVjNoR2',
 'coding music ': '6irm6oF0AMHMNUXDnoZZCL',
 'spring ': '2Q5l8i8D6qoT2ID2L1uNIV',
 'study new ': '7rkwo8iWk631naUIVe94fy',
 'jeannie <3': '04KEaRrMoDMi6iNDt6HN5b',
 'hmwrk': '5DXemOwm6LmS6xFWCVOA3R',
 'different state of mind ': '4K46i5JvI82UFLSaAs3gRH',
 'real?': '0OY59cJNNCCFaLVobRaCas',
 '888': '2PTUB2vwKNf4X6MfoVZ6oq',
 'too good to gatekeep ': '5VlWJBuXkhkI3TddxpDFqa',
 'viv ❤️\u200d🔥': '6Bu6IMLJZmQtEoTeI7QN01',
 'fug': '4DZjwi83plE5iMqGchMio9',
 'absolutely do not drink on wellbutrin under any circumstances at all except for this playlist ': '6oHPWOuzVX5hUPFGkFQfoj',
 '555': '7d0Ock7TfabyEL1fCsRZUL',
 'the depression got hands today! ': '0xXpRaDnIDJvGH8kxWsl4K',
 'finals week ': '1MUBtgWaRRIXzxRgpXxnaa',
 '♊︎ songs ': '1TPze4S0evvTXbLrW1jWjf',
 'Your Top Songs 2021': '37i9dQZF1EUMDoJuT8yJsl',
 'z&v car playlist': '7eVKu4Stl6U5D0lZzeYkiC',
 'r en bee ish': '1HrkdnxMzqXuTpvrCwu5ne',
 "it's getting dark at 5": '18Nca3cDRcsZiumw5Genak',
 'indie pop Bible': '3A7O9FqRNIgzmX9iORSSeD',
 'turn-off auto capitalization ': '6GUVn4Q1veBaUJ34uM5GEM',
 'i live at the library ': '2NWqrLIO1WeQCNLctl0gS2',
 'the perfect PSU tape': '6KeZtHskqBLPpV2aK79QbH',
 'puking and crying': '27BHKyTZdaq1xbxoDWPKMH',
 'my silly little degree ': '0H4LDH6gub89aBpbWbaTgm',
 'we outside getting too expensive ': '52GY4u2HIQuXoM4FTTmcI5',
 'base model ': '2ew85vhTXRlBWeqIrpnX2f',
 'suburbia ': '3L0P9H0pGVTwgWCuRm655n',
 'playa 2': '5l3Pw8ZxdesJM15GjDrKfb',
 'one day off': '1IbamjuA0u1pa3Ebmoi2cv',
 'playa': '3aqb14LSmT4ucYir7U07sI',
 'mmmmmmm completely dissociated': '4K9tKtMm4UYG9MMiiKQkR7',
 'i’m better than you? ': '5aH7xNSUKwZFRe3702ImFa',
 '2000': '3oBa7oLN43RrupdhiFLzHX',
 'wknd ': '4bpdgM09OstPyf1Wx5YH6n',
 'how could i forget': '6krNDtKZ4Nt4T2NAW06OAu',
 'inject this into my bloodstream ': '6QBDYEHjce3uVPQexe7QDn'}

Recommendation Set Up (vectorization, etc.)¶

In [ ]:
def create_necessary_outputs(playlist_name,id_dic, df):
    """ 

    params:
        playlist_name (str): name of the playlist you'd like to pull from the spotify API
        id_dic (dic): dictionary that maps playlist_name to playlist_id
        df (pandas dataframe): spotify datafram
    
    """

    #generate playlist dataframe
    playlist = pd.DataFrame()
    playlist_name = playlist_name

    for ix, i in enumerate(sp.playlist(id_dic[playlist_name])['tracks']['items']):
        #print(i['track']['artists'][0]['name'])
        playlist.loc[ix, 'artist'] = i['track']['artists'][0]['name']
        playlist.loc[ix, 'name'] = i['track']['name']
        playlist.loc[ix, 'id'] = i['track']['id'] # ['uri'].split(':')[2]
        playlist.loc[ix, 'url'] = i['track']['album']['images'][1]['url']
        playlist.loc[ix, 'date_added'] = i['added_at']

    playlist['date_added'] = pd.to_datetime(playlist['date_added'])

    playlist = playlist[playlist['id'].isin(df['id'].values)].sort_values('date_added',ascending = False)

    return playlist
In [ ]:
playlist_sleep = create_necessary_outputs('sleep', id_name,tracks_df)
playlist_playa = create_necessary_outputs('playa',id_name, tracks_df)
playlist_hw = create_necessary_outputs('hmwrk',id_name, tracks_df)
In [ ]:
playlist_playa
Out[ ]:
artist name id url date_added
95 Wallows Remember When 5naar7XewEOAjOywIp6Jjq https://i.scdn.co/image/ab67616d00001e0284feca... 2021-06-11 21:22:28+00:00
94 Dayglow Hot Rod 0zePbRMJ9sd7wsZRlbPQua https://i.scdn.co/image/ab67616d00001e02ccd63a... 2021-06-11 21:22:23+00:00
93 Dominic Fike Babydoll 7yNf9YjeO5JXUE3JEBgnYc https://i.scdn.co/image/ab67616d00001e027b1b6f... 2021-06-11 21:22:21+00:00
89 Phony Ppl Why iii Love The Moon. 2x5Frs6ts14U4MSLrQQlXg https://i.scdn.co/image/ab67616d00001e02d9ac65... 2021-06-11 05:21:35+00:00
88 WILLOW Wait a Minute! 0y60itmpH0aPKsFiGxmtnh https://i.scdn.co/image/ab67616d00001e026ee651... 2021-06-11 05:21:07+00:00
87 Steve Lacy Dark Red 37y7iDayfwm3WXn5BiAoRk https://i.scdn.co/image/ab67616d00001e02263886... 2021-06-11 05:21:00+00:00
86 Clairo Flaming Hot Cheetos 1F6IbA7di42uPc3cff8PXV https://i.scdn.co/image/ab67616d00001e0290c00a... 2021-06-11 05:20:56+00:00
84 Childish Gambino Sober 5NhlpQ6BOIz3S5welptk1W https://i.scdn.co/image/ab67616d00001e02720659... 2021-06-11 05:20:32+00:00
83 Frank Ocean Pink + White 3xKsf9qdS1CyvXSMEid6g8 https://i.scdn.co/image/ab67616d00001e02c5649a... 2021-06-11 05:20:29+00:00
82 Harry Styles Adore You 3jjujdWJ72nww5eGnfs2E7 https://i.scdn.co/image/ab67616d00001e0277fdcf... 2021-06-11 05:20:23+00:00
76 Lonely God Marlboro Nights 755inykyaG4w22GWAsA3MX https://i.scdn.co/image/ab67616d00001e0298392b... 2021-06-11 05:19:23+00:00
75 Arctic Monkeys Baby I'm Yours 0SzvmWfOhoxZVGrmvb56YL https://i.scdn.co/image/ab67616d00001e02fc5f23... 2021-06-11 05:19:22+00:00
74 Bruno Major Easily 2k9N4caeCIJLOWwWwssrEM https://i.scdn.co/image/ab67616d00001e02e6dfae... 2021-06-11 05:19:21+00:00
73 Saint Motel My Type 2Iq6HhIquO7JKr0KfTNLzU https://i.scdn.co/image/ab67616d00001e028ba29b... 2021-06-11 05:19:21+00:00
69 Miguel waves - Tame Impala Remix 3lB0GMiI5KxDbTOG8V3bOx https://i.scdn.co/image/ab67616d00001e02c4daf0... 2021-06-11 05:19:19+00:00
68 Clairo Sofia 7B3z0ySL9Rr0XvZEAjWZzM https://i.scdn.co/image/ab67616d00001e0233ccb6... 2021-06-11 05:19:18+00:00
66 HONNE Day 1 ◑ 6ZzYETKetIfNUsZUb23jgG https://i.scdn.co/image/ab67616d00001e02210933... 2021-06-11 05:19:16+00:00
57 John Mayer New Light 3bH4HzoZZFq8UpZmI2AMgV https://i.scdn.co/image/ab67616d00001e0221f02a... 2021-06-11 05:19:07+00:00
55 Coldplay Adventure of a Lifetime 69uxyAqqPIsUyTO8txoP2M https://i.scdn.co/image/ab67616d00001e028ff7c3... 2021-06-11 05:19:02+00:00
54 Mac Miller Good News 1DWZUa5Mzf2BwzpHtgbHPY https://i.scdn.co/image/ab67616d00001e0226b7dd... 2021-06-11 05:19:01+00:00
52 Briston Maroney Freakin' Out On the Interstate 6Fqf0OTfB9VPfYk2HfBhPn https://i.scdn.co/image/ab67616d00001e02d9ab9c... 2021-06-11 05:18:57+00:00
45 Declan McKenna Why Do You Feel So Down 5Bge1Dsqjc14hhGguYML5w https://i.scdn.co/image/ab67616d00001e02ec8be2... 2021-06-11 05:18:48+00:00
41 Wallows These Days 4gZDCOFuLCxCRWNhSEcOtJ https://i.scdn.co/image/ab67616d00001e02789e81... 2021-06-11 05:18:43+00:00
40 Surfaces 24 / 7 / 365 0ClnfM4PI0wjlCVTJc9lP7 https://i.scdn.co/image/ab67616d00001e02e4a2cf... 2021-06-11 05:18:42+00:00
39 Wallows Are You Bored Yet? (feat. Clairo) 57RA3JGafJm5zRtKJiKPIm https://i.scdn.co/image/ab67616d00001e0284feca... 2021-06-11 05:18:41+00:00
38 Tame Impala Borderline 5hM5arv9KDbCHS0k9uqwjr https://i.scdn.co/image/ab67616d00001e0258267b... 2021-06-11 05:18:40+00:00
37 Fleetwood Mac Dreams - 2004 Remaster 0ofHAoxe9vBkTCp2UQIavz https://i.scdn.co/image/ab67616d00001e02e52a59... 2021-06-11 05:18:39+00:00
30 The Neighbourhood Stargazing 0VF7YLIxSQKyNiFL3X6MmN https://i.scdn.co/image/ab67616d00001e023552d3... 2021-06-11 05:18:27+00:00
28 Tame Impala New Person, Same Old Mistakes 52ojopYMUzeNcudsoz7O9D https://i.scdn.co/image/ab67616d00001e029e1cfc... 2021-06-11 05:18:19+00:00
25 The Cure Friday I'm in Love 263aNAQCeFSWipk896byo6 https://i.scdn.co/image/ab67616d00001e02e410fa... 2021-06-11 05:17:53+00:00
23 Still Woozy Goodie Bag 4vHNeBWDQpVCmGbaccrRzi https://i.scdn.co/image/ab67616d00001e025ddbd6... 2021-06-11 05:17:47+00:00
22 Vance Joy Saturday Sun 2RiBogNRfulkNf7fVbPOrJ https://i.scdn.co/image/ab67616d00001e029ac709... 2021-06-11 05:17:42+00:00
21 PUBLIC Make You Mine 5iFwAOB2TFkPJk8sMlxP8g https://i.scdn.co/image/ab67616d00001e020d0621... 2021-06-11 05:17:40+00:00
17 boy pablo Feeling Lonely 5uIRujGRZv5t4fGKkUTv4n https://i.scdn.co/image/ab67616d00001e028d7d35... 2021-06-11 05:17:16+00:00
14 MGMT Electric Feel 3FtYbEfBqAlGO46NUDQSAt https://i.scdn.co/image/ab67616d00001e028b32b1... 2021-06-11 05:17:13+00:00
13 boy pablo Dance, Baby! 5EV4bGHxVN0kHpcAFvgnTt https://i.scdn.co/image/ab67616d00001e0239806e... 2021-06-11 05:17:12+00:00
12 Cage The Elephant Cigarette Daydreams 0lkQOB949M2gLyut86aJ1b https://i.scdn.co/image/ab67616d00001e0248831f... 2021-06-11 05:17:08+00:00
11 Passion Pit Take a Walk 4Sfa7hdVkqlM8UW5LsSY3F https://i.scdn.co/image/ab67616d00001e02f86054... 2021-06-11 05:17:07+00:00
10 Dayglow Can I Call You Tonight? 64lsIF5pw0sJY0gV5kz0RN https://i.scdn.co/image/ab67616d00001e02ccd63a... 2021-06-11 05:17:04+00:00
9 Wallows Pleaser 11zf7m4vw9Ze7cer9Nyhk1 https://i.scdn.co/image/ab67616d00001e022f9f93... 2021-06-11 05:17:03+00:00
8 Declan McKenna Brazil 4sNG6zQBmtq7M8aeeKJRMQ https://i.scdn.co/image/ab67616d00001e02ec8be2... 2021-06-11 05:17:01+00:00
6 BØRNS Electric Love 2GiJYvgVaD2HtM8GqD9EgQ https://i.scdn.co/image/ab67616d00001e02cc2cf9... 2021-06-11 05:16:59+00:00
3 HUNNY Televised 35Ki1lvKPC2sFBD3GmKdRG https://i.scdn.co/image/ab67616d00001e0299727d... 2021-06-11 05:16:50+00:00
2 Hippo Campus Buttercup 6iCJCZqDJjmBxt07Oid6FI https://i.scdn.co/image/ab67616d00001e02d65c69... 2021-06-11 05:16:49+00:00
1 Colony House Silhouettes 612JlaWJl5l6VIrcBck5QB https://i.scdn.co/image/ab67616d00001e0226c197... 2021-06-11 05:16:48+00:00
0 Saint Motel Sweet Talk 6kcHg7XL6SKyPNd78daRBL https://i.scdn.co/image/ab67616d00001e0225dd1a... 2021-06-11 05:16:45+00:00
In [ ]:
playlist_sleep
Out[ ]:
artist name id url date_added
23 Billie Eilish listen before i go 0tMSssfxAL2oV8Vri0mFHE https://i.scdn.co/image/ab67616d00001e0250a314... 2022-02-21 08:32:15+00:00
22 Billie Eilish i love you 6CcJMwBtXByIz4zQLzFkKc https://i.scdn.co/image/ab67616d00001e0250a314... 2022-02-21 08:31:54+00:00
21 Billie Eilish when the party's over 43zdsphuZLzwA9k4DJhU0I https://i.scdn.co/image/ab67616d00001e0250a314... 2022-02-21 08:31:49+00:00
20 Billie Eilish idontwannabeyouanymore 41zXlQxzTi6cGAjpOXyLYH https://i.scdn.co/image/ab67616d00001e02a9f6c0... 2022-02-21 08:31:34+00:00
19 Rex Orange County Pluto Projector 4EWBhKf1fOFnyMtUzACXEc https://i.scdn.co/image/ab67616d00001e02733e6d... 2022-02-21 08:28:35+00:00
5 The Neighbourhood Baby Came Home 2 / Valentines 40gvh6jP5qxMJuMmF9lG9A https://i.scdn.co/image/ab67616d00001e02306658... 2022-02-21 08:15:22+00:00
3 Taylor Swift mirrorball 0ZNU020wNYvgW84iljPkPP https://i.scdn.co/image/ab67616d00001e0295f754... 2022-02-21 08:15:14+00:00
In [ ]:
def generate_playlist_feature(complete_feature_set, playlist_df, weight_factor):
    """ 
    Summarize a user's playlist into a single vector

    params: 
        complete_feature_set (pandas dataframe): Dataframe which includes all of the features for the spotify songs
        playlist_df (pandas dataframe): playlist dataframe
        weight_factor (float): float value that represents the recency bias. The larger the recency bias, the most priority recent songs get. Value should be close to 1. 
        
    Returns: 
        playlist_feature_set_weighted_final (pandas series): single feature that summarizes the playlist
        complete_feature_set_nonplaylist (pandas dataframe): 
    """

    complete_feature_set_playlist = complete_feature_set[complete_feature_set['id'].isin(playlist_df['id'].values)]
    complete_feature_set_playlist = complete_feature_set_playlist.merge(playlist_df[['id','date_added']], on = 'id', how = 'inner')
    complete_feature_set_nonplaylist = complete_feature_set[~complete_feature_set['id'].isin(playlist_df['id'].values)]

    playlist_feature_set = complete_feature_set_playlist.sort_values('date_added',ascending=False)

    most_recent_date = playlist_feature_set.iloc[0,-1]

    for ix, row in playlist_feature_set.iterrows():
        playlist_feature_set.loc[ix,'months_from_recent'] = int((most_recent_date.to_pydatetime() - row.iloc[-1].to_pydatetime()).days / 30)

    playlist_feature_set['weight'] = playlist_feature_set['months_from_recent'].apply(lambda x: weight_factor ** (-x))

    playlist_feature_set_weighted = playlist_feature_set.copy()
    #print(playlist_feature_set_weighted.iloc[:,:-4].columns)
    playlist_feature_set_weighted.update(playlist_feature_set_weighted.iloc[:,:-4].mul(playlist_feature_set_weighted.weight,0))
    playlist_feature_set_weighted_final = playlist_feature_set_weighted.iloc[:, :-4]
    #playlist_feature_set_weighted_final['id'] = playlist_feature_set['id']

    return playlist_feature_set_weighted_final.sum(axis = 0), complete_feature_set_nonplaylist
In [ ]:
complete_feature_set_playlist_vector_sleep, complete_feature_set_nonplaylist_sleep = generate_playlist_feature(complete_feature_set, playlist_sleep, 1.09)
In [ ]:
complete_feature_set_playlist_vector_sleep.shape
Out[ ]:
(146,)
In [ ]:
complete_feature_set_playlist_vector_playa, complete_feature_set_nonplaylist_playa = generate_playlist_feature(complete_feature_set, playlist_playa, 1.09)
In [ ]:
complete_feature_set_playlist_vector_playa.shape
Out[ ]:
(146,)

song recommendations¶

In [ ]:
def generate_playlist_recos(df, features, nonplaylist_features):
    """ 
    Pull songs from a specific playlist.

    Parameters: 
        df (pandas dataframe): spotify dataframe
        features (pandas series): summarized playlist feature
        nonplaylist_features (pandas dataframe): feature set of songs that are not in the selected playlist
        
    Returns: 
        non_playlist_df_top_40: Top 40 recommendations for that playlist
    """

    non_playlist_df = df[df['id'].isin(nonplaylist_features['id'].values)]
    non_playlist_df['sim'] = cosine_similarity(nonplaylist_features.drop('id', axis = 1).values, features.values.reshape(1, -1))[:,0]
    non_playlist_df_top_40 = non_playlist_df.sort_values('sim',ascending = False).head(40)
    non_playlist_df_top_40['url'] = non_playlist_df_top_40['id'].apply(lambda x: sp.track(x)['album']['images'][1]['url'])

    return non_playlist_df_top_40
In [ ]:
sleep_top40 = generate_playlist_recos(tracks_df, complete_feature_set_playlist_vector_sleep, complete_feature_set_nonplaylist_sleep)
In [ ]:
sleep_top40
Out[ ]:
id name popularity duration_ms explicit artists id_artists release_date danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo time_signature artists_upd_v1 artists_upd_v2 artists_upd artists_upd3 names_strs artists_song genre_x year popularity_red genre_y sim url
86651 7F1CiKqrY44kh5cDqwHOnx Love Is Gone - Acoustic 84 176972 0 ['SLANDER', 'Dylan Matthew'] ['20DZAfCuP1TKZl5KcY7z3Q', '6d0ZjIp5L7Ygy2l02H... 2019-11-13 0.541 0.153 6 -10.654 1 0.0303 0.882 0.000002 0.1600 0.359 139.644 4 [SLANDER, Dylan Matthew] [] [SLANDER, Dylan Matthew] ['SLANDER', 'Dylan Matthew'] Love Is Gone - Acoustic ['SLANDER', 'Dylan Matthew']Love Is Gone - Aco... [] 2019 16 NaN 0.869998 https://i.scdn.co/image/ab67616d00001e023892a2...
86764 4ja2gzrNh9VNigzoXfmbwD Mariposa 80 210000 0 ['Peach Tree Rascals'] ['0imE3buPhAowREqCrr4CYe'] 2019-08-28 0.676 0.525 9 -5.880 1 0.0280 0.617 0.000000 0.3560 0.421 112.011 4 [Peach Tree Rascals] [] [Peach Tree Rascals] ['Peach Tree Rascals'] Mariposa ['Peach Tree Rascals']Mariposa [] 2019 16 NaN 0.865005 https://i.scdn.co/image/ab67616d00001e02180bec...
86751 0ecC8p17cDNlxHXkuYqeR6 Surrender 80 183103 0 ['Natalie Taylor'] ['2WxjxdeF7GGdcCK276qViY'] 2019-10-29 0.390 0.448 5 -8.570 0 0.0276 0.800 0.182000 0.1070 0.077 144.890 5 [Natalie Taylor] [] [Natalie Taylor] ['Natalie Taylor'] Surrender ['Natalie Taylor']Surrender [] 2019 16 NaN 0.864713 https://i.scdn.co/image/ab67616d00001e02688ac6...
86678 2TH65lNHgvLxCKXM3apjxI Callaita 82 250534 1 ['Bad Bunny', 'Tainy'] ['4q3ewBCX7sLwd24euuV69X', '0GM7qgcRCORpGnfcN2... 2019-05-31 0.610 0.624 2 -4.773 1 0.3090 0.600 0.000002 0.2430 0.244 176.169 4 [Bad Bunny, Tainy] [] [Bad Bunny, Tainy] ['Bad Bunny', 'Tainy'] Callaita ['Bad Bunny', 'Tainy']Callaita [] 2019 16 NaN 0.862979 https://i.scdn.co/image/ab67616d00001e024aef42...
86716 1TQXIltqoZ5XXyfCbAeSQQ Dancing With Your Ghost 81 197732 0 ['Sasha Sloan'] ['4xnihxcoXWK3UqryOSnbw5'] 2019-06-28 0.629 0.327 11 -8.285 1 0.0290 0.761 0.000030 0.1030 0.381 74.953 4 [Sasha Sloan] [] [Sasha Sloan] ['Sasha Sloan'] Dancing With Your Ghost ['Sasha Sloan']Dancing With Your Ghost [] 2019 16 NaN 0.862877 https://i.scdn.co/image/ab67616d00001e02141cf7...
86643 3H3r2nKWa3Yk5gt8xgmsEt This City 84 194853 0 ['Sam Fischer'] ['6L1XC7NrmgWRlwAeLJvVtA'] 2019-12-11 0.605 0.377 11 -6.213 1 0.0443 0.733 0.000000 0.0808 0.519 73.877 4 [Sam Fischer] [] [Sam Fischer] ['Sam Fischer'] This City ['Sam Fischer']This City [] 2019 16 NaN 0.860396 https://i.scdn.co/image/ab67616d00001e0270e6c7...
86746 4SSnFejRGlZikf02HLewEF bury a friend 80 193143 0 ['Billie Eilish'] ['6qqNVTkY8uBg9cP3Jd7DAH'] 2019-03-29 0.905 0.389 8 -14.505 1 0.3320 0.740 0.162000 0.1060 0.196 120.046 4 [Billie Eilish] [] [Billie Eilish] ['Billie Eilish'] bury a friend ['Billie Eilish']bury a friend [] 2019 16 NaN 0.855724 https://i.scdn.co/image/ab67616d00001e0250a314...
86707 0t3ZvGKlmYmVsDzBJAXK8C Goodbyes (feat. Young Thug) 81 174853 1 ['Post Malone', 'Young Thug'] ['246dkjvS1zLTtiykXe5h60', '50co4Is1HCEo8bhOyU... 2019-09-06 0.548 0.653 5 -3.875 1 0.0810 0.456 0.000000 0.1030 0.163 150.068 4 [Post Malone, Young Thug] [] [Post Malone, Young Thug] ['Post Malone', 'Young Thug'] Goodbyes (feat. Young Thug) ['Post Malone', 'Young Thug']Goodbyes (feat. Y... [] 2019 16 NaN 0.852133 https://i.scdn.co/image/ab67616d00001e029478c8...
86702 6Qs4SXO9dwPj5GKvVOv8Ki Dancing With A Stranger (with Normani) 81 171030 0 ['Sam Smith', 'Normani'] ['2wY79sveU1sp5g7SokKOiI', '2cWZOOzeOm4WmBJRnD... 2019-01-11 0.741 0.520 8 -7.513 1 0.0656 0.450 0.000002 0.2220 0.347 102.998 4 [Sam Smith, Normani] [] [Sam Smith, Normani] ['Sam Smith', 'Normani'] Dancing With A Stranger (with Normani) ['Sam Smith', 'Normani']Dancing With A Strange... [] 2019 16 NaN 0.851991 https://i.scdn.co/image/ab67616d00001e023b52ec...
86675 2HYvkdq6lpFXkVz9Tfqi8r Big Gangsta 83 243463 1 ['Kevin Gates'] ['1gPhS1zisyXr5dHTYZyiMe'] 2019-05-31 0.879 0.574 10 -5.602 0 0.3910 0.519 0.000009 0.1440 0.346 144.911 4 [Kevin Gates] [] [Kevin Gates] ['Kevin Gates'] Big Gangsta ['Kevin Gates']Big Gangsta [] 2019 16 NaN 0.851778 https://i.scdn.co/image/ab67616d00001e023a0b50...
147176 00nvL9u5K8jEJ6TSxGdtPK Me Enamoré 71 253830 0 ['Jay Wheeler', 'DJ Nelson'] ['2cPqdH7XMvwaBJEVjheH8g', '2ydZrTy8U3kOMOzx20... 2019-11-28 0.495 0.357 11 -7.555 1 0.0439 0.968 0.001040 0.1180 0.456 179.740 4 [Jay Wheeler, DJ Nelson] [] [Jay Wheeler, DJ Nelson] ['Jay Wheeler', 'DJ Nelson'] Me Enamoré ['Jay Wheeler', 'DJ Nelson']Me Enamoré [] 2019 14 NaN 0.851079 https://i.scdn.co/image/ab67616d00001e0266cfd6...
86732 3XF5xLJHOQQRbWya6hBp7d you should see me in a crown 80 180953 0 ['Billie Eilish'] ['6qqNVTkY8uBg9cP3Jd7DAH'] 2019-03-29 0.678 0.533 4 -10.485 1 0.1860 0.462 0.219000 0.1390 0.323 150.455 4 [Billie Eilish] [] [Billie Eilish] ['Billie Eilish'] you should see me in a crown ['Billie Eilish']you should see me in a crown [] 2019 16 NaN 0.850435 https://i.scdn.co/image/ab67616d00001e0250a314...
86731 5stPVcRqb4qixbafP9e8lt Hola - Remix 80 249520 0 ['Dalex', 'Lenny Tavárez', 'Chencho Corleone',... ['0KPX4Ucy9dk82uj4GpKesn', '1pQWsZQehhS4wavwh7... 2019-11-01 0.654 0.672 0 -5.980 0 0.3110 0.471 0.000000 0.0781 0.343 181.857 4 [Dalex, Lenny Tavárez, Chencho Corleone, Juhn,... [] [Dalex, Lenny Tavárez, Chencho Corleone, Juhn,... ['Dalex', 'Lenny Tavárez', 'Chencho Corleone',... Hola - Remix ['Dalex', 'Lenny Tavárez', 'Chencho Corleone',... [] 2019 16 NaN 0.850209 https://i.scdn.co/image/ab67616d00001e028f0f79...
184749 0abQySNYXaj7H86yJVQ02B Dime quien ama de verdad 61 226848 0 ['Karen Méndez', 'Juacko'] ['0txXDZCdXBzha20sgN1GRk', '0LLnP7NEsEQ1pSCfsu... 2019-06-14 0.806 0.472 3 -5.908 1 0.1530 0.810 0.000000 0.3640 0.462 139.922 4 [Karen Méndez, Juacko] [] [Karen Méndez, Juacko] ['Karen Méndez', 'Juacko'] Dime quien ama de verdad ['Karen Méndez', 'Juacko']Dime quien ama de ve... [] 2019 12 NaN 0.850012 https://i.scdn.co/image/ab67616d00001e0256b3cb...
86771 0bMbDctzMmTyK2j74j3nF3 Alone, Pt. II 80 179053 0 ['Alan Walker', 'Ava Max'] ['7vk5e3vY1uw9plTHJAMwjN', '4npEfmQ6YuiwW1GpUm... 2019-12-27 0.670 0.668 3 -4.306 0 0.0422 0.536 0.000000 0.1330 0.608 88.033 4 [Alan Walker, Ava Max] [] [Alan Walker, Ava Max] ['Alan Walker', 'Ava Max'] Alone, Pt. II ['Alan Walker', 'Ava Max']Alone, Pt. II [] 2019 16 NaN 0.849733 https://i.scdn.co/image/ab67616d00001e02153261...
516761 0sNZsYY8LSCCM4tC2y0zR1 Binhi 60 216774 0 ['Arthur Nery'] ['7uDdl5V5AETSFY7K3muu22'] 2019-10-25 0.545 0.309 5 -10.235 1 0.0313 0.961 0.000733 0.1890 0.232 123.767 4 [Arthur Nery] [] [Arthur Nery] ['Arthur Nery'] Binhi ['Arthur Nery']Binhi [] 2019 12 NaN 0.849693 https://i.scdn.co/image/ab67616d00001e0214b8c2...
86704 60iSKGrGazRzICtMjADNSM Hold Me While You Wait 81 205687 0 ['Lewis Capaldi'] ['4GNC7GD6oZMSxPGyXy4MNB'] 2019-05-17 0.688 0.530 11 -5.507 1 0.0333 0.443 0.000000 0.0995 0.162 106.958 4 [Lewis Capaldi] [] [Lewis Capaldi] ['Lewis Capaldi'] Hold Me While You Wait ['Lewis Capaldi']Hold Me While You Wait [] 2019 16 NaN 0.849576 https://i.scdn.co/image/ab67616d00001e02fc2101...
111356 3znQ9i61vfe2E7URHlOiyc I Love You 3000 72 209734 0 ['Stephanie Poetri'] ['0HS00NN7MAfF59aJnfcxSO'] 2019-06-03 0.648 0.382 6 -7.850 1 0.0396 0.911 0.000000 0.3930 0.408 90.099 4 [Stephanie Poetri] [] [Stephanie Poetri] ['Stephanie Poetri'] I Love You 3000 ['Stephanie Poetri']I Love You 3000 [] 2019 14 NaN 0.849319 https://i.scdn.co/image/ab67616d00001e0290189b...
319683 4RIi1gNmKDzSH04Vvws2DK Ya No Te Hago Falta 62 161600 0 ['Sen Senra'] ['5lWasZeo8uWQk6GD8czJLq'] 2019-11-29 0.560 0.311 9 -8.508 1 0.0380 0.934 0.000060 0.0706 0.452 180.050 4 [Sen Senra] [] [Sen Senra] ['Sen Senra'] Ya No Te Hago Falta ['Sen Senra']Ya No Te Hago Falta [] 2019 12 NaN 0.848782 https://i.scdn.co/image/ab67616d00001e02a42686...
324899 3hRMlpsBV8yC3kfRxVWBsX колыбельная 64 233398 0 ['Rauf & Faik'] ['0a3zDmrvmZcORfPeONPvfL'] 2019-12-06 0.764 0.505 0 -7.634 0 0.0546 0.840 0.001680 0.1100 0.215 147.946 4 [Rauf & Faik] [] [Rauf & Faik] ['Rauf & Faik'] колыбельная ['Rauf & Faik']колыбельная [] 2019 12 NaN 0.847832 https://i.scdn.co/image/ab67616d00001e02e5412d...
147209 6qoIFQfdmaQF9A1gb67tR7 Ocean 70 155947 0 ['KAROL G'] ['790FomKkXshlbRYZFtlgla'] 2019-05-03 0.727 0.482 11 -6.193 1 0.1150 0.933 0.000000 0.3880 0.487 74.930 4 [KAROL G] [] [KAROL G] ['KAROL G'] Ocean ['KAROL G']Ocean [] 2019 14 NaN 0.847693 https://i.scdn.co/image/ab67616d00001e02813d0c...
397918 7f7BUgSlavlGnvxd3KZN88 Pianista da Rua 6 60 212571 1 ['Tribo da Periferia'] ['1xxS2WrLlgl9QNGEUCsbPG'] 2019-12-27 0.704 0.499 7 -10.010 0 0.0820 0.814 0.000167 0.1530 0.348 139.969 4 [Tribo da Periferia] [] [Tribo da Periferia] ['Tribo da Periferia'] Pianista da Rua 6 ['Tribo da Periferia']Pianista da Rua 6 [] 2019 12 NaN 0.847133 https://i.scdn.co/image/ab67616d00001e02bca2de...
107990 7mvma3mO5hSyhVbJDXxtFz Grateful 63 185992 0 ['Mahalia'] ['16rCzZOMQX7P8Kmn5YKexI'] 2019-04-26 0.655 0.351 7 -7.628 0 0.1530 0.730 0.000176 0.2910 0.316 141.689 4 [Mahalia] [] [Mahalia] ['Mahalia'] Grateful ['Mahalia']Grateful [] 2019 12 NaN 0.847104 https://i.scdn.co/image/ab67616d00001e02dbf53d...
387582 0Xtln8sTYKPvc0hFxA3IXn Por Siempre Mi Amor - Versión Acústica 63 177040 0 ['Banda MS de Sergio Lizárraga', 'Natalia Jimé... ['2C6i0I5RiGzDKN9IAF8reh', '0j8QSBQZ9MNSGjHr1V... 2019-09-13 0.656 0.222 10 -7.869 1 0.0301 0.939 0.000011 0.0793 0.400 125.125 4 [Banda MS de Sergio Lizárraga, Natalia Jiménez] [] [Banda MS de Sergio Lizárraga, Natalia Jiménez] ['Banda MS de Sergio Lizárraga', 'Natalia Jimé... Por Siempre Mi Amor - Versión Acústica ['Banda MS de Sergio Lizárraga', 'Natalia Jimé... [] 2019 12 NaN 0.847073 https://i.scdn.co/image/ab67616d00001e0293cbc4...
408367 3ymuBMTviroWLuf1jMsMVf Sorai 64 278333 0 ['Nadin Amizah'] ['20zafXaLhm5IcXnSU93rNn'] 2019-01-01 0.555 0.239 0 -12.445 1 0.0303 0.951 0.002900 0.1600 0.164 143.585 4 [Nadin Amizah] [] [Nadin Amizah] ['Nadin Amizah'] Sorai ['Nadin Amizah']Sorai [] 2019 12 NaN 0.847041 https://i.scdn.co/image/ab67616d00001e027d6b0a...
226628 7MtVPRGtZl6rPjMfLoI3Lh Fuck it I love you 72 218288 1 ['Lana Del Rey'] ['00FQb4jTyendYWaN8pK0wa'] 2019-08-30 0.534 0.452 9 -10.732 0 0.0359 0.895 0.001650 0.1250 0.175 129.974 4 [Lana Del Rey] [] [Lana Del Rey] ['Lana Del Rey'] Fuck it I love you ['Lana Del Rey']Fuck it I love you [] 2019 14 NaN 0.846833 https://i.scdn.co/image/ab67616d00001e02879e93...
173649 240WkSGaUBJMBmHLqS33WA Little Things 60 189907 1 ['Jessica Mauboy'] ['6rHWAH6F4mr2AViSxMV673'] 2019-10-18 0.502 0.321 9 -8.601 1 0.0441 0.851 0.000000 0.1560 0.348 121.991 4 [Jessica Mauboy] [] [Jessica Mauboy] ['Jessica Mauboy'] Little Things ['Jessica Mauboy']Little Things [] 2019 12 NaN 0.846759 https://i.scdn.co/image/ab67616d00001e02fcab9a...
184763 7CF4dWivLZf3Hdg0FKL9Eb Al Mismo Tiempo 62 250838 0 ['Rauw Alejandro'] ['1mcTU81TzQhprhouKaTkpq'] 2019-05-31 0.786 0.492 9 -5.007 1 0.0374 0.800 0.000000 0.1060 0.203 132.914 4 [Rauw Alejandro] [] [Rauw Alejandro] ['Rauw Alejandro'] Al Mismo Tiempo ['Rauw Alejandro']Al Mismo Tiempo [] 2019 12 NaN 0.846481 https://i.scdn.co/image/ab67616d00001e02d6f354...
408503 2CVChktEKBsM6v4IfdFU5k double take 60 171743 0 ['dhruv'] ['70NcAr4ZtA3FAqU16iQZSb'] 2019-05-24 0.663 0.434 8 -11.177 1 0.0648 0.828 0.000000 0.2490 0.225 109.075 4 [dhruv] [] [dhruv] ['dhruv'] double take ['dhruv']double take [] 2019 12 NaN 0.846267 https://i.scdn.co/image/ab67616d00001e02bfa45a...
319729 2QJcrJNa4KGxQ6bw0MH3Zx Con La Miel En Los Labios 62 202447 0 ['Aitana'] ['7eLcDZDYHXZCebtQmVFL25'] 2019-06-07 0.662 0.331 6 -8.350 1 0.0407 0.869 0.000000 0.1140 0.432 113.779 3 [Aitana] [] [Aitana] ['Aitana'] Con La Miel En Los Labios ['Aitana']Con La Miel En Los Labios [] 2019 12 NaN 0.846207 https://i.scdn.co/image/ab67616d00001e02feb133...
256603 0Uon5NsSAkBDx69XYOaQ5P Stay 71 177153 0 ['Gracie Abrams'] ['4tuJ0bMpJh08umKkEXKUI5'] 2019-11-21 0.618 0.370 10 -10.500 1 0.0543 0.883 0.000000 0.1230 0.433 114.260 4 [Gracie Abrams] [] [Gracie Abrams] ['Gracie Abrams'] Stay ['Gracie Abrams']Stay [] 2019 14 NaN 0.845973 https://i.scdn.co/image/ab67616d00001e028f0e4f...
339605 4MtqfY0YxmvpQWszO7pbdQ Aslında 64 173774 0 ['Resit Kemal', 'Lust'] ['3xtQQsJvIjKcyaLT4uMsWz', '49FuEUcoEf5YIcQdtE... 2019-03-22 0.692 0.529 0 -8.619 0 0.0903 0.773 0.000000 0.3380 0.543 130.008 4 [Resit Kemal, Lust] [] [Resit Kemal, Lust] ['Resit Kemal', 'Lust'] Aslında ['Resit Kemal', 'Lust']Aslında [] 2019 12 NaN 0.845894 https://i.scdn.co/image/ab67616d00001e020b9808...
110575 5WkCcSa78lM1Ym4LXzJUiN La La Lost You - Acoustic Version 73 208511 1 ['NIKI', '88rising'] ['2kxP07DLgs4xlWz8YHlvfh', '1AhjOkOLkbHUfcHDSE... 2019-08-11 0.606 0.196 1 -11.652 1 0.0553 0.908 0.000000 0.3480 0.391 100.873 4 [NIKI, 88rising] [] [NIKI, 88rising] ['NIKI', '88rising'] La La Lost You - Acoustic Version ['NIKI', '88rising']La La Lost You - Acoustic ... [] 2019 14 NaN 0.845758 https://i.scdn.co/image/ab67616d00001e0247669a...
368902 5ZQFP6rsYhNaFuQNaoTzgV Hug 64 159111 0 ['SEVENTEEN'] ['7nqOGRxlXj7N2JYbgNEjYH'] 2019-01-21 0.469 0.233 4 -9.381 1 0.0442 0.907 0.000000 0.1080 0.393 135.308 4 [SEVENTEEN] [] [SEVENTEEN] ['SEVENTEEN'] Hug ['SEVENTEEN']Hug [] 2019 12 NaN 0.845683 https://i.scdn.co/image/ab67616d00001e025185eb...
87238 7vRia9rlEuTDQxkfXIKySi It's Not The Same Anymore 74 386200 0 ['Rex Orange County'] ['7pbDxGE6nQSZVfiFdq9lOL'] 2019-10-25 0.666 0.317 5 -10.644 1 0.0327 0.873 0.000037 0.1110 0.359 117.676 4 [Rex Orange County] [] [Rex Orange County] ['Rex Orange County'] It's Not The Same Anymore ['Rex Orange County']It's Not The Same Anymore [] 2019 14 NaN 0.845641 https://i.scdn.co/image/ab67616d00001e02733e6d...
194605 0QHOIQxRlIPYPJ1HLgIN8S Dices Que Te Vas 62 202053 0 ['KAROL G', 'Anuel AA'] ['790FomKkXshlbRYZFtlgla', '2R21vXR83lH98kGeO9... 2019-05-03 0.506 0.287 7 -10.009 1 0.0643 0.861 0.000000 0.6050 0.570 147.076 4 [KAROL G, Anuel AA] [] [KAROL G, Anuel AA] ['KAROL G', 'Anuel AA'] Dices Que Te Vas ['KAROL G', 'Anuel AA']Dices Que Te Vas [] 2019 12 NaN 0.845163 https://i.scdn.co/image/ab67616d00001e02813d0c...
147442 2pV1sqUkOCYD9c3l6SKVi3 Quédate 60 201800 0 ['Kany Garcia', 'Tommy Torres'] ['69UypehHabb68utzfjAVlV', '264nbMzGPSkDZqTY8n... 2019-05-17 0.639 0.344 0 -9.340 0 0.0325 0.801 0.000002 0.0892 0.279 137.729 4 [Kany Garcia, Tommy Torres] [] [Kany Garcia, Tommy Torres] ['Kany Garcia', 'Tommy Torres'] Quédate ['Kany Garcia', 'Tommy Torres']Quédate [] 2019 12 NaN 0.845111 https://i.scdn.co/image/ab67616d00001e02ac1ed1...
339619 3RojH1cvKfidA8bYUgCVOZ Karanlık 61 229090 0 ['Dolu Kadehi Ters Tut'] ['0PhqM7UAxtvWYi5j4MwxSl'] 2019-04-05 0.491 0.678 9 -10.106 0 0.2600 0.841 0.001460 0.2610 0.185 180.009 4 [Dolu Kadehi Ters Tut] [] [Dolu Kadehi Ters Tut] ['Dolu Kadehi Ters Tut'] Karanlık ['Dolu Kadehi Ters Tut']Karanlık [] 2019 12 NaN 0.845079 https://i.scdn.co/image/ab67616d00001e0261d675...
397917 79BHjj4YkvbpOlMvG6wf3n boa memória - ao vivo 61 214088 0 ['Luan Santana'] ['3qvcCP2J0fWi0m0uQDUf6r'] 2019-08-22 0.394 0.498 7 -6.853 1 0.0341 0.759 0.000000 0.5180 0.400 132.740 4 [Luan Santana] [] [Luan Santana] ['Luan Santana'] boa memória - ao vivo ['Luan Santana']boa memória - ao vivo [] 2019 12 NaN 0.844938 https://i.scdn.co/image/ab67616d00001e02833364...
524880 1AfSccccjs0qPxCeuKAbEr Du Med Dig, Akustisk 60 197947 0 ['Miriam Bryant'] ['2zd9YxlsQvA5mkZ1NarYVQ'] 2019-07-26 0.519 0.422 3 -4.868 1 0.0298 0.851 0.000000 0.1190 0.566 113.307 4 [Miriam Bryant] [] [Miriam Bryant] ['Miriam Bryant'] Du Med Dig, Akustisk ['Miriam Bryant']Du Med Dig, Akustisk [] 2019 12 NaN 0.844917 https://i.scdn.co/image/ab67616d00001e02318f76...
In [ ]:
playa_top40 = generate_playlist_recos(tracks_df, complete_feature_set_playlist_vector_playa, complete_feature_set_nonplaylist_playa)
In [ ]:
playa_top40
Out[ ]:
id name popularity duration_ms explicit artists id_artists release_date danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo time_signature artists_upd_v1 artists_upd_v2 artists_upd artists_upd3 names_strs artists_song genre year popularity_red sim url
85144 0Gx4VrHzS7pZOEAGrmXXBH La Bicicleta 74 229510 0 ['Carlos Vives', 'Shakira'] ['4vhNDa5ycK0ST968ek7kRr', '0EmeFodog0BfCgMzAI... 2017-11-10 0.745 0.944 0 -3.959 1 0.1340 0.2100 0.000001 0.3330 0.951 179.991 4 [Carlos Vives, Shakira] [] [Carlos Vives, Shakira] ['Carlos Vives', 'Shakira'] La Bicicleta ['Carlos Vives', 'Shakira']La Bicicleta [] 2017 14 0.750769 https://i.scdn.co/image/ab67616d00001e02575fb6...
85393 2Q85xwXagilpHKTfdrbC7M La Rompe Corazones 72 204520 0 ['Daddy Yankee', 'Ozuna'] ['4VMYDCV2IEDYJArk749S6m', '1i8SpTcr7yvPOmcqrb... 2017-01-13 0.685 0.859 5 -2.595 0 0.0553 0.1160 0.000000 0.3170 0.891 176.018 4 [Daddy Yankee, Ozuna] [] [Daddy Yankee, Ozuna] ['Daddy Yankee', 'Ozuna'] La Rompe Corazones ['Daddy Yankee', 'Ozuna']La Rompe Corazones [] 2017 14 0.739582 https://i.scdn.co/image/ab67616d00001e02396586...
85132 0pSBuHjILhNEo55xK1zrRt Rolex 74 238587 0 ['Ayo & Teo'] ['27mFvqQj8KpjmdKIqcw1mG'] 2017-03-15 0.804 0.886 1 -2.512 1 0.0400 0.0837 0.000000 0.2660 0.789 144.946 4 [Ayo & Teo] [] [Ayo & Teo] ['Ayo & Teo'] Rolex ['Ayo & Teo']Rolex [] 2017 14 0.737295 https://i.scdn.co/image/ab67616d00001e0279dbd9...
164289 6DsPM0HMAXN5x4pzBR6bbo Aftershock 65 230400 0 ['Macky Gee', 'Stuart Rowe'] ['5EDztvTkyoKtK0ZdEdhOFx', '2qwGUda21fiqR1wm69... 2017-08-07 0.688 0.922 6 0.444 0 0.0362 0.2630 0.030200 0.1860 0.695 175.054 4 [Macky Gee, Stuart Rowe] [] [Macky Gee, Stuart Rowe] ['Macky Gee', 'Stuart Rowe'] Aftershock ['Macky Gee', 'Stuart Rowe']Aftershock [] 2017 13 0.734932 https://i.scdn.co/image/ab67616d00001e02d16080...
85155 1m69ELEgE6k5ZWsap40ozt Se Preparó 74 188080 0 ['Ozuna'] ['1i8SpTcr7yvPOmcqrbnVXY'] 2017-08-25 0.739 0.821 1 -4.233 1 0.0852 0.2220 0.000010 0.3110 0.693 171.077 4 [Ozuna] [] [Ozuna] ['Ozuna'] Se Preparó ['Ozuna']Se Preparó [] 2017 14 0.732087 https://i.scdn.co/image/ab67616d00001e02b0a875...
85623 70lnL3QaSOIIyMa2X9aVRL Perro Fiel (feat. Nicky Jam) 70 195213 0 ['Shakira', 'Nicky Jam'] ['0EmeFodog0BfCgMzAIvKQp', '1SupJlEpv7RS2tPNRa... 2017-05-26 0.750 0.760 1 -4.836 1 0.1980 0.1870 0.000000 0.0548 0.893 183.817 4 [Shakira, Nicky Jam] [] [Shakira, Nicky Jam] ['Shakira', 'Nicky Jam'] Perro Fiel (feat. Nicky Jam) ['Shakira', 'Nicky Jam']Perro Fiel (feat. Nick... [] 2017 14 0.731973 https://i.scdn.co/image/ab67616d00001e02d05d3a...
146659 1WoDc1x28zHmxnPvvM5GLh La Asesina 65 204733 0 ['Zacarias Ferreira'] ['1LKPL2O3vA3ozNsmshDg3o'] 2017-09-27 0.810 0.803 3 -3.042 1 0.0349 0.3850 0.000000 0.1400 0.883 130.049 4 [Zacarias Ferreira] [] [Zacarias Ferreira] ['Zacarias Ferreira'] La Asesina ['Zacarias Ferreira']La Asesina [] 2017 13 0.731828 https://i.scdn.co/image/ab67616d00001e024cdc89...
85539 4qknM1pQz53QOyfDVTjcM9 Me Enamoré 70 226893 0 ['Shakira'] ['0EmeFodog0BfCgMzAIvKQp'] 2017-05-26 0.740 0.879 9 -2.251 0 0.1050 0.1930 0.000082 0.0928 0.948 103.710 4 [Shakira] [] [Shakira] ['Shakira'] Me Enamoré ['Shakira']Me Enamoré [] 2017 14 0.730764 https://i.scdn.co/image/ab67616d00001e02d05d3a...
85134 6rPO02ozF3bM7NnOV4h6s2 Despacito - Remix 74 228827 0 ['Luis Fonsi', 'Daddy Yankee', 'Justin Bieber'] ['4V8Sr092TqfHkfAA5fXXqG', '4VMYDCV2IEDYJArk74... 2017-04-17 0.653 0.816 2 -4.353 1 0.1670 0.2280 0.000000 0.0967 0.816 178.085 4 [Luis Fonsi, Daddy Yankee, Justin Bieber] [] [Luis Fonsi, Daddy Yankee, Justin Bieber] ['Luis Fonsi', 'Daddy Yankee', 'Justin Bieber'] Despacito - Remix ['Luis Fonsi', 'Daddy Yankee', 'Justin Bieber'... [] 2017 14 0.728892 https://i.scdn.co/image/ab67616d00001e02a6a335...
219166 6yZbbWkQ0cIjNXhOaBAfWP Pesao 68 208027 1 ['Santa Estilo', 'Cartel De Santa', 'Millonario'] ['59XuCTeNNS0fVgBrFoPNfG', '07PdYoE4jVRF6Ut40G... 2017-09-08 0.721 0.721 7 -4.564 0 0.2620 0.2380 0.000000 0.2940 0.892 173.432 4 [Santa Estilo, Cartel De Santa, Millonario] [] [Santa Estilo, Cartel De Santa, Millonario] ['Santa Estilo', 'Cartel De Santa', 'Millonario'] Pesao ['Santa Estilo', 'Cartel De Santa', 'Millonari... [] 2017 13 0.728485 https://i.scdn.co/image/ab67616d00001e02dfacd0...
85311 2Nk3gXgekore0lfB7PCnub El Paciente 72 211267 0 ['Alfredo Olivas'] ['5xYNmNkaWRqu3e5F4UXME8'] 2017-08-18 0.706 0.713 3 -3.609 1 0.0367 0.3190 0.000000 0.1140 0.973 142.002 3 [Alfredo Olivas] [] [Alfredo Olivas] ['Alfredo Olivas'] El Paciente ['Alfredo Olivas']El Paciente [] 2017 14 0.727861 https://i.scdn.co/image/ab67616d00001e0296cce9...
397139 2E8Shaw5menB7ImgCQA4th Beijo De Varanda - Ao Vivo 65 161678 0 ['Bruno & Marrone'] ['5JXhkyafynxCvxtov7C1PV'] 2017-09-01 0.801 0.812 2 -5.097 1 0.1320 0.3300 0.000000 0.2080 0.760 140.062 4 [Bruno & Marrone] [] [Bruno & Marrone] ['Bruno & Marrone'] Beijo De Varanda - Ao Vivo ['Bruno & Marrone']Beijo De Varanda - Ao Vivo [] 2017 13 0.727826 https://i.scdn.co/image/ab67616d00001e02294c66...
276697 0OlS52TmtK2gPaEtdmr7DN No Such Thing as a Broken Heart 65 176893 0 ['Old Dominion'] ['6y8XlgIV8BLlIg1tT1R10i'] 2017-08-25 0.651 0.782 8 -4.295 1 0.0718 0.2950 0.000000 0.1070 0.945 171.987 4 [Old Dominion] [] [Old Dominion] ['Old Dominion'] No Such Thing as a Broken Heart ['Old Dominion']No Such Thing as a Broken Heart [] 2017 13 0.727659 https://i.scdn.co/image/ab67616d00001e02d25f1f...
85362 0atfY1ew83Ql9nNnJiD2t5 Bonita 72 265747 0 ['J Balvin', 'Jowell & Randy'] ['1vyhD5VmyZ7KMfW5gqLgo5', '4IMAo2UQchVFyPH24P... 2017-06-02 0.775 0.867 5 -1.582 0 0.0414 0.0132 0.006840 0.2780 0.869 96.038 4 [J Balvin, Jowell & Randy] [] [J Balvin, Jowell & Randy] ['J Balvin', 'Jowell & Randy'] Bonita ['J Balvin', 'Jowell & Randy']Bonita [] 2017 14 0.727155 https://i.scdn.co/image/ab67616d00001e022e5575...
271618 33471tzU1VghDg9zNgGRpz Hotel Key 68 166573 0 ['Old Dominion'] ['6y8XlgIV8BLlIg1tT1R10i'] 2017-08-25 0.758 0.867 11 -5.087 1 0.0475 0.1520 0.000000 0.3080 0.964 102.018 4 [Old Dominion] [] [Old Dominion] ['Old Dominion'] Hotel Key ['Old Dominion']Hotel Key [] 2017 13 0.726988 https://i.scdn.co/image/ab67616d00001e02d25f1f...
111229 46HdsiK0uR26B2dY9QPzda Deja vu 69 196480 0 ['Prince Royce', 'Shakira'] ['3MHaV05u0io8fQbZ2XPtlC', '0EmeFodog0BfCgMzAI... 2017-02-24 0.732 0.801 9 -3.859 1 0.0327 0.3900 0.000000 0.3100 0.824 123.981 4 [Prince Royce, Shakira] [] [Prince Royce, Shakira] ['Prince Royce', 'Shakira'] Deja vu ['Prince Royce', 'Shakira']Deja vu [] 2017 13 0.726436 https://i.scdn.co/image/ab67616d00001e026c1180...
84918 5ygDXis42ncn6kYG14lEVG Baby Shark 77 80927 0 ['Pinkfong'] ['7cTXfwpe9peK0UE1bZyIWZ'] 2017-07-27 0.829 0.886 8 -1.746 1 0.1120 0.2590 0.000000 0.0559 0.777 115.056 4 [Pinkfong] [] [Pinkfong] ['Pinkfong'] Baby Shark ['Pinkfong']Baby Shark [] 2017 15 0.726293 https://i.scdn.co/image/ab67616d00001e0211723f...
194112 5ZA9ItQp7DyG6pPkSsq3Bn Eres Mi Sueño 67 300773 0 ['Septeto Acarey'] ['5Vz74ibGHBQaUa2ALDOH0v'] 2017-02-13 0.626 0.801 3 -5.144 0 0.0342 0.2610 0.000025 0.2030 0.903 169.956 4 [Septeto Acarey] [] [Septeto Acarey] ['Septeto Acarey'] Eres Mi Sueño ['Septeto Acarey']Eres Mi Sueño [] 2017 13 0.726140 https://i.scdn.co/image/ab67616d00001e021974a7...
85332 0oCSitNlzsQfuIapF9tXRQ A Través Del Vaso 72 188662 0 ['Grupo Arranke'] ['1A773r2lVYAnmt8uwb5BOu'] 2017-10-25 0.620 0.695 5 -2.979 1 0.0298 0.3600 0.000015 0.3470 0.921 143.927 3 [Grupo Arranke] [] [Grupo Arranke] ['Grupo Arranke'] A Través Del Vaso ['Grupo Arranke']A Través Del Vaso [] 2017 14 0.725507 https://i.scdn.co/image/ab67616d00001e027daf93...
397158 2JpTwRVXioTZSdizBGAhUH Sun Goes Down 65 203586 0 ['Bruno Martini', 'Isadora'] ['5veVxxPm1vzgi6pO2iVA8L', '15mR9E7xTmVPmKeHcP... 2017-06-09 0.838 0.752 8 -5.434 0 0.0340 0.3890 0.001130 0.0822 0.901 121.958 4 [Bruno Martini, Isadora] [] [Bruno Martini, Isadora] ['Bruno Martini', 'Isadora'] Sun Goes Down ['Bruno Martini', 'Isadora']Sun Goes Down [] 2017 13 0.724729 https://i.scdn.co/image/ab67616d00001e0232cea6...
146768 5YzA563GXTuwQaRq24z1k5 Como Antes (feat. Wisin) 66 210773 0 ['Yandel', 'Wisin'] ['0eHQ9o50hj6ZDNBt6Ys1sD', '3E6xrwgnVfYCrCs0eP... 2017-09-08 0.813 0.876 1 -4.278 0 0.1720 0.1820 0.000000 0.3940 0.746 94.987 4 [Yandel, Wisin] [] [Yandel, Wisin] ['Yandel', 'Wisin'] Como Antes (feat. Wisin) ['Yandel', 'Wisin']Como Antes (feat. Wisin) [] 2017 13 0.723159 https://i.scdn.co/image/ab67616d00001e02b54d1c...
85000 6mICuAdrwEjh6Y6lroV2Kg Chantaje (feat. Maluma) 76 195840 0 ['Shakira', 'Maluma'] ['0EmeFodog0BfCgMzAIvKQp', '1r4hJ1h58CWwUQe3Mx... 2017-05-26 0.852 0.773 8 -2.921 0 0.0776 0.1870 0.000030 0.1590 0.907 102.034 4 [Shakira, Maluma] [] [Shakira, Maluma] ['Shakira', 'Maluma'] Chantaje (feat. Maluma) ['Shakira', 'Maluma']Chantaje (feat. Maluma) [] 2017 15 0.723037 https://i.scdn.co/image/ab67616d00001e02d05d3a...
243379 1MSZs6TLitwTs3KxdqIdtD Uhorčík 32 179067 0 ['Heľenine Oči'] ['6Skz2qHpugnIIG9JkipMfG'] 2017-01-10 0.909 0.962 9 -4.380 1 0.0863 0.2590 0.000000 0.1280 0.973 129.962 4 [Heľenine Oči] [] [Heľenine Oči] ['Heľenine Oči'] Uhorčík ['Heľenine Oči']Uhorčík [] 2017 6 0.722553 https://i.scdn.co/image/ab67616d00001e02189241...
146674 1Bqg4yFeVDJxchh6MjkGKy Chambea 68 192001 1 ['Bad Bunny'] ['4q3ewBCX7sLwd24euuV69X'] 2017-12-01 0.856 0.866 0 -3.494 1 0.1590 0.2280 0.001540 0.1640 0.638 116.005 4 [Bad Bunny] [] [Bad Bunny] ['Bad Bunny'] Chambea ['Bad Bunny']Chambea [] 2017 13 0.722385 https://i.scdn.co/image/ab67616d00001e02147689...
146699 1rXojdsUqqxGj2WCmJGWHP Vacaciones 67 238813 0 ['Wisin'] ['3E6xrwgnVfYCrCs0ePERDz'] 2017-12-01 0.777 0.911 6 -3.223 0 0.1730 0.2460 0.000000 0.2570 0.704 96.017 4 [Wisin] [] [Wisin] ['Wisin'] Vacaciones ['Wisin']Vacaciones [] 2017 13 0.722339 https://i.scdn.co/image/ab67616d00001e02c7524a...
184429 1CFICGHfnZH6tXVKIYtYJp Bye Bye 50 196747 0 ['Mozart La Para', 'Chimbala', 'Liro Shaq'] ['0odliLZMTk45CEVzF3Zocl', '4VVEpEhC8NcR7AqNEd... 2017-11-02 0.856 0.959 4 -0.511 0 0.0537 0.0680 0.001440 0.5040 0.955 120.052 4 [Mozart La Para, Chimbala, Liro Shaq] [] [Mozart La Para, Chimbala, Liro Shaq] ['Mozart La Para', 'Chimbala', 'Liro Shaq'] Bye Bye ['Mozart La Para', 'Chimbala', 'Liro Shaq']Bye... [] 2017 10 0.722180 https://i.scdn.co/image/ab67616d00001e020332e8...
226157 0hhXziDUO0wNYPsstDQWN6 Overnight 65 219604 0 ['Parcels'] ['3oKRxpszQKUjjaHz388fVA'] 2017-06-21 0.815 0.819 8 -9.494 0 0.0521 0.3640 0.055500 0.1150 0.864 119.986 4 [Parcels] [] [Parcels] ['Parcels'] Overnight ['Parcels']Overnight [] 2017 13 0.722015 https://i.scdn.co/image/ab67616d00001e02cb0697...
111217 42tFTth2jcF7iSo0RBjfJF Peek-A-Boo 69 189050 0 ['Red Velvet'] ['1z4g3DjTBBZKhvAroFlhOM'] 2017-11-17 0.839 0.902 1 -3.612 0 0.0536 0.0868 0.002570 0.2720 0.639 114.953 4 [Red Velvet] [] [Red Velvet] ['Red Velvet'] Peek-A-Boo ['Red Velvet']Peek-A-Boo [] 2017 13 0.721793 https://i.scdn.co/image/ab67616d00001e026538b8...
324558 3UcyaCWLsc0XDhzXHUuH1S Audubon 66 134963 1 ['$uicideboy$'] ['1VPmR4DJC1PlOtd0IADAO0'] 2017-05-26 0.768 0.785 1 -5.057 1 0.3320 0.1540 0.000012 0.7790 0.698 169.029 4 [$uicideboy$] [] [$uicideboy$] ['$uicideboy$'] Audubon ['$uicideboy$']Audubon [] 2017 13 0.721587 https://i.scdn.co/image/ab67616d00001e02b53ec3...
173199 6X5OFBbrsHRsyO1zP7udgr Man's Not Hot 66 186027 0 ['Big Shaq'] ['7mnAzEmgquhrVtGob81SmO'] 2017-09-22 0.905 0.884 0 -4.076 1 0.2360 0.1110 0.000083 0.1070 0.588 135.048 4 [Big Shaq] [] [Big Shaq] ['Big Shaq'] Man's Not Hot ['Big Shaq']Man's Not Hot [] 2017 13 0.721358 https://i.scdn.co/image/ab67616d00001e029ff9c3...
219179 3mtThJNrqACi4f6GJeduAR Pero La Recuerdo 65 242907 0 ['Pancho Barraza', 'Kalimba'] ['5dmU7FrmtbQaSzIvGsE4Jp', '4RjamFQJNT8nVbTKXJ... 2017-10-27 0.674 0.711 7 -3.127 0 0.0724 0.1950 0.000000 0.0881 0.848 179.854 4 [Pancho Barraza, Kalimba] [] [Pancho Barraza, Kalimba] ['Pancho Barraza', 'Kalimba'] Pero La Recuerdo ['Pancho Barraza', 'Kalimba']Pero La Recuerdo [] 2017 13 0.721266 https://i.scdn.co/image/ab67616d00001e02b11b95...
84751 7JJmb5XwzOO8jgpou264Ml There's Nothing Holdin' Me Back 83 199440 0 ['Shawn Mendes'] ['7n2wHs1TKAczGzO7Dd2rGr'] 2017-04-20 0.866 0.813 11 -4.063 0 0.0554 0.3800 0.000000 0.0779 0.969 121.998 4 [Shawn Mendes] [] [Shawn Mendes] ['Shawn Mendes'] There's Nothing Holdin' Me Back ['Shawn Mendes']There's Nothing Holdin' Me Back [] 2017 16 0.721252 https://i.scdn.co/image/ab67616d00001e02ea3ef7...
397137 2EVaHMfXlWw4ANf6Mb8c5P Na Conta Da Loucura - Ao Vivo 67 165075 0 ['Bruno & Marrone'] ['5JXhkyafynxCvxtov7C1PV'] 2017-09-01 0.746 0.822 11 -5.634 0 0.0735 0.2890 0.000000 0.1560 0.735 136.121 4 [Bruno & Marrone] [] [Bruno & Marrone] ['Bruno & Marrone'] Na Conta Da Loucura - Ao Vivo ['Bruno & Marrone']Na Conta Da Loucura - Ao Vivo [] 2017 13 0.721208 https://i.scdn.co/image/ab67616d00001e02294c66...
84850 5DoLhdU27owX1NMrKLUbUl Lean (feat. Towy, Osquel, Beltito & Sammy & Fa... 79 260545 1 ['Super Yei', 'Towy', 'Osquel', 'Beltito', 'Sa... ['6HqgxkTt9KGyt27zYrwVan', '7iXYHQPYLQSz3b3hbP... 2017-03-31 0.863 0.669 6 -5.952 0 0.2820 0.1110 0.000000 0.0569 0.947 164.062 4 [Super Yei, Towy, Osquel, Beltito, Sammy & Fal... [] [Super Yei, Towy, Osquel, Beltito, Sammy & Fal... ['Super Yei', 'Towy', 'Osquel', 'Beltito', 'Sa... Lean (feat. Towy, Osquel, Beltito & Sammy & Fa... ['Super Yei', 'Towy', 'Osquel', 'Beltito', 'Sa... [] 2017 15 0.720664 https://i.scdn.co/image/ab67616d00001e0255fd94...
164197 3coYPmuUrK9Yr6kqsMSr7H Neljä Vuodenaikaa 45 188542 0 ['Petri Nygård'] ['4l0zTor5S32Yly4uw96Bto'] 2017-06-14 0.912 0.915 11 -4.243 0 0.0442 0.0891 0.000002 0.3270 0.958 132.014 4 [Petri Nygård] [] [Petri Nygård] ['Petri Nygård'] Neljä Vuodenaikaa ['Petri Nygård']Neljä Vuodenaikaa [] 2017 9 0.720086 https://i.scdn.co/image/ab67616d00001e02780efd...
387385 5IdaVuUzEDF3T56U5vS5ck Que Te Vaya Bien 67 217587 0 ['Grupo Jalado'] ['71mQj8OrRgy3smRMjnFioM'] 2017-09-07 0.822 0.705 7 -3.147 1 0.0373 0.4950 0.000012 0.1150 0.938 94.011 4 [Grupo Jalado] [] [Grupo Jalado] ['Grupo Jalado'] Que Te Vaya Bien ['Grupo Jalado']Que Te Vaya Bien [] 2017 13 0.719955 https://i.scdn.co/image/ab67616d00001e0268f98f...
164352 2NF8A7C6tICScdRaZ0BrEe Katchi - Ofenbach vs. Nick Waterhouse 67 151011 0 ['Ofenbach', 'Nick Waterhouse'] ['4AKwRarlmsUlLjIwt38NLw', '0V7uVrIYr4FwFvUN9S... 2017-08-25 0.837 0.793 11 -5.048 0 0.0567 0.0261 0.000090 0.0743 0.870 124.988 4 [Ofenbach, Nick Waterhouse] [] [Ofenbach, Nick Waterhouse] ['Ofenbach', 'Nick Waterhouse'] Katchi - Ofenbach vs. Nick Waterhouse ['Ofenbach', 'Nick Waterhouse']Katchi - Ofenba... [] 2017 13 0.719885 https://i.scdn.co/image/ab67616d00001e02ea926e...
235476 7M3ERUXyBIdEbqwUGFgCzO Esa Mami 52 165148 0 ['DJ Yayo'] ['6sPVGPkxslll1c4pdHvxYh'] 2017-03-27 0.759 0.855 11 -2.527 0 0.0820 0.2470 0.042900 0.0646 0.942 202.055 4 [DJ Yayo] [] [DJ Yayo] ['DJ Yayo'] Esa Mami ['DJ Yayo']Esa Mami [] 2017 10 0.719642 https://i.scdn.co/image/ab67616d00001e02fb143f...
122755 6k2900NjJeVqZM55G3Danu Bum Bum Tam Tam 69 213989 1 ['MC Fioti', 'Future', 'J Balvin', 'Stefflon D... ['2W6kbe0nm96COrHzNmfLLd', '1RyvyyTE3xzB2ZywiA... 2017-12-15 0.896 0.675 1 -3.908 1 0.1240 0.3460 0.000008 0.2620 0.659 131.999 4 [MC Fioti, Future, J Balvin, Stefflon Don, Jua... [] [MC Fioti, Future, J Balvin, Stefflon Don, Jua... ['MC Fioti', 'Future', 'J Balvin', 'Stefflon D... Bum Bum Tam Tam ['MC Fioti', 'Future', 'J Balvin', 'Stefflon D... [] 2017 13 0.719568 https://i.scdn.co/image/ab67616d00001e02d1243f...
387399 5teILTGkJkSJXI03XeMIj2 De Periódico Un Gallito 62 197930 1 ['LEGADO 7'] ['7yCGrS6Xh3UngvY6Ad5sMJ'] 2017-04-20 0.773 0.895 11 -2.783 0 0.0934 0.4520 0.000000 0.2240 0.961 115.076 3 [LEGADO 7] [] [LEGADO 7] ['LEGADO 7'] De Periódico Un Gallito ['LEGADO 7']De Periódico Un Gallito [] 2017 12 0.719051 https://i.scdn.co/image/ab67616d00001e0241368d...
In [ ]: