{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Import Dependancies" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Load Data Files" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "dir = \"SpotGenTrack/Data Sources/\"\n", "albums = pd.read_csv(dir + \"spotify_albums.csv\")\n", "artists = pd.read_csv(dir + \"spotify_artists.csv\")\n", "tracks = pd.read_csv(dir + \"spotify_tracks.csv\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | Unnamed: 0 | \n", "album_type | \n", "artist_id | \n", "available_markets | \n", "external_urls | \n", "href | \n", "id | \n", "images | \n", "name | \n", "release_date | \n", "release_date_precision | \n", "total_tracks | \n", "track_id | \n", "track_name_prev | \n", "uri | \n", "type | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "0 | \n", "single | \n", "3DiDSECUqqY1AuBP8qtaIa | \n", "['AD', 'AE', 'AR', 'AT', 'AU', 'BE', 'BG', 'BH... | \n", "{'spotify': 'https://open.spotify.com/album/1g... | \n", "https://api.spotify.com/v1/albums/1gAM7M4rBwEb... | \n", "1gAM7M4rBwEbSPeAQR2nx1 | \n", "[{'height': 640, 'url': 'https://i.scdn.co/ima... | \n", "If I Ain't Got You EP | \n", "2019-02-08 | \n", "day | \n", "6 | \n", "2iejTMy9XZ8Gaae0aQ2yl0 | \n", "track_32 | \n", "spotify:album:1gAM7M4rBwEbSPeAQR2nx1 | \n", "album | \n", "
1 | \n", "1 | \n", "album | \n", "6s1pCNXcbdtQJlsnM1hRIA | \n", "['AD', 'AE', 'AR', 'AT', 'AU', 'BE', 'BG', 'BH... | \n", "{'spotify': 'https://open.spotify.com/album/4K... | \n", "https://api.spotify.com/v1/albums/4KfJZV7WfolY... | \n", "4KfJZV7WfolYlxBzOTo66s | \n", "[{'height': 640, 'url': 'https://i.scdn.co/ima... | \n", "Shostakovich Symphony No.5 - Four Romances on ... | \n", "2019-03-01 | \n", "day | \n", "8 | \n", "1WQfghEjszJJ4H8MAWrQ2C | \n", "track_11 | \n", "spotify:album:4KfJZV7WfolYlxBzOTo66s | \n", "album | \n", "
2 | \n", "2 | \n", "single | \n", "5YjfNaHq05WrwldRe1QSBc | \n", "['AD', 'AE', 'AR', 'AT', 'AU', 'BE', 'BG', 'BH... | \n", "{'spotify': 'https://open.spotify.com/album/7n... | \n", "https://api.spotify.com/v1/albums/7nLYY7uAVUb5... | \n", "7nLYY7uAVUb57kpd7tZxnS | \n", "[{'height': 640, 'url': 'https://i.scdn.co/ima... | \n", "Take My Bass | \n", "2019-03-14 | \n", "day | \n", "1 | \n", "3jJKj4QTK3v18ZSwpk7AcV | \n", "track_15 | \n", "spotify:album:7nLYY7uAVUb57kpd7tZxnS | \n", "album | \n", "
3 | \n", "3 | \n", "single | \n", "2G9Vc16JCpnZmK4uGH46Fa | \n", "['AD', 'AE', 'AR', 'AT', 'AU', 'BE', 'BG', 'BH... | \n", "{'spotify': 'https://open.spotify.com/album/6p... | \n", "https://api.spotify.com/v1/albums/6p20Rt4x2Qn5... | \n", "6p20Rt4x2Qn5mUMRi1s6pj | \n", "[{'height': 640, 'url': 'https://i.scdn.co/ima... | \n", "Hypnotizing (Are U) | \n", "2016-11-16 | \n", "day | \n", "1 | \n", "1xGtDafUZbHyYC3Xarcbrj | \n", "track_46 | \n", "spotify:album:6p20Rt4x2Qn5mUMRi1s6pj | \n", "album | \n", "
4 | \n", "4 | \n", "single | \n", "2dwM9OcE4c3Ph1UBINSodx | \n", "['AD', 'AE', 'AR', 'AT', 'AU', 'BE', 'BG', 'BH... | \n", "{'spotify': 'https://open.spotify.com/album/1X... | \n", "https://api.spotify.com/v1/albums/1XeoOqC1q7U2... | \n", "1XeoOqC1q7U2iyLEQJ64cu | \n", "[{'height': 640, 'url': 'https://i.scdn.co/ima... | \n", "Sunshine | \n", "2018-07-20 | \n", "day | \n", "1 | \n", "0gWtsXvXOzAT6FtM3ur8in | \n", "track_10 | \n", "spotify:album:1XeoOqC1q7U2iyLEQJ64cu | \n", "album | \n", "
\n", " | Unnamed: 0 | \n", "artist_popularity | \n", "followers | \n", "genres | \n", "id | \n", "name | \n", "track_id | \n", "track_name_prev | \n", "type | \n", "
---|---|---|---|---|---|---|---|---|---|
0 | \n", "0 | \n", "44 | \n", "23230 | \n", "['sertanejo', 'sertanejo pop', 'sertanejo trad... | \n", "4mGnpjhqgx4RUdsIJiURdo | \n", "Juliano Cezar | \n", "0wmDmAILuW9e2aRttkl4aC | \n", "track_9 | \n", "artist | \n", "
1 | \n", "1 | \n", "22 | \n", "313 | \n", "[] | \n", "1dLnVku4VQUOLswwDFvRc9 | \n", "The Grenadines | \n", "4wqwj0gA8qPZKLl5WVqXml | \n", "track_30 | \n", "artist | \n", "
2 | \n", "2 | \n", "26 | \n", "1596 | \n", "['danish pop rock'] | \n", "6YVY310fjfUzKi8hiqR7iK | \n", "Gangway | \n", "1bFqWDbvHmZe2f4Nf9qaD8 | \n", "track_38 | \n", "artist | \n", "
3 | \n", "3 | \n", "31 | \n", "149 | \n", "['uk alternative pop'] | \n", "2VElyouiCfoYPDJluzwJwK | \n", "FADES | \n", "3MFSUBAidPzRBbIS7BDj1S | \n", "track_34 | \n", "artist | \n", "
4 | \n", "4 | \n", "21 | \n", "11 | \n", "['french baroque'] | \n", "4agVy03qW8juSysCTUOuDI | \n", "Jean-Pierre Guignon | \n", "2r3q57FhxdsCyYr0kuDq4b | \n", "track_26 | \n", "artist | \n", "
\n", " | Unnamed: 0 | \n", "acousticness | \n", "album_id | \n", "analysis_url | \n", "artists_id | \n", "available_markets | \n", "country | \n", "danceability | \n", "disc_number | \n", "duration_ms | \n", "... | \n", "preview_url | \n", "speechiness | \n", "tempo | \n", "time_signature | \n", "track_href | \n", "track_name_prev | \n", "track_number | \n", "uri | \n", "valence | \n", "type | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "0 | \n", "0.294 | \n", "0D3QufeCudpQANOR7luqdr | \n", "https://api.spotify.com/v1/audio-analysis/5qlj... | \n", "['3mxJuHRn2ZWD5OofvJtDZY'] | \n", "['AD', 'AE', 'AR', 'AT', 'AU', 'BE', 'BG', 'BH... | \n", "BE | \n", "0.698 | \n", "1.0 | \n", "235584.0 | \n", "... | \n", "https://p.scdn.co/mp3-preview/1b05a902da3a251d... | \n", "0.0262 | \n", "115.018 | \n", "4.0 | \n", "https://api.spotify.com/v1/tracks/5qljLQuKnNJf... | \n", "track_14 | \n", "1.0 | \n", "spotify:track:5qljLQuKnNJf4F4vfxQB0V | \n", "0.6220 | \n", "track | \n", "
1 | \n", "1 | \n", "0.863 | \n", "1bcqsH5UyTBzmh9YizdsBE | \n", "https://api.spotify.com/v1/audio-analysis/3VAX... | \n", "['4xWMewm6CYMstu0sPgd9jJ'] | \n", "['AD', 'AE', 'AR', 'AT', 'AU', 'BE', 'BG', 'BH... | \n", "BE | \n", "0.719 | \n", "1.0 | \n", "656960.0 | \n", "... | \n", "https://p.scdn.co/mp3-preview/d8140736a6131cb5... | \n", "0.9220 | \n", "115.075 | \n", "3.0 | \n", "https://api.spotify.com/v1/tracks/3VAX2MJdmdqA... | \n", "track_3 | \n", "3.0 | \n", "spotify:track:3VAX2MJdmdqARLSU5hPMpm | \n", "0.5890 | \n", "track | \n", "
2 | \n", "2 | \n", "0.750 | \n", "4tKijjmxGClg4JOLAyo2qE | \n", "https://api.spotify.com/v1/audio-analysis/1L3Y... | \n", "['3hYaK5FF3YAglCj5HZgBnP'] | \n", "['GB'] | \n", "BE | \n", "0.466 | \n", "1.0 | \n", "492840.0 | \n", "... | \n", "https://p.scdn.co/mp3-preview/c8af28fb15185b18... | \n", "0.9440 | \n", "79.565 | \n", "4.0 | \n", "https://api.spotify.com/v1/tracks/1L3YAhsEMrGV... | \n", "track_4 | \n", "4.0 | \n", "spotify:track:1L3YAhsEMrGVvCgDXj2TYn | \n", "0.0850 | \n", "track | \n", "
3 | \n", "3 | \n", "0.763 | \n", "6FeJF5r8roonnKraJxr4oB | \n", "https://api.spotify.com/v1/audio-analysis/6aCe... | \n", "['2KQsUB9DRBcJk17JWX1eXD'] | \n", "['AD', 'AE', 'AR', 'AT', 'AU', 'BE', 'BG', 'BH... | \n", "BE | \n", "0.719 | \n", "1.0 | \n", "316578.0 | \n", "... | \n", "https://p.scdn.co/mp3-preview/7629b8e9f31f6e9b... | \n", "0.9380 | \n", "112.822 | \n", "3.0 | \n", "https://api.spotify.com/v1/tracks/6aCe9zzoZmCo... | \n", "track_9 | \n", "1.0 | \n", "spotify:track:6aCe9zzoZmCojX7bbgKKtf | \n", "0.5330 | \n", "track | \n", "
4 | \n", "4 | \n", "0.770 | \n", "4tKijjmxGClg4JOLAyo2qE | \n", "https://api.spotify.com/v1/audio-analysis/1Vo8... | \n", "['3hYaK5FF3YAglCj5HZgBnP'] | \n", "['GB'] | \n", "BE | \n", "0.460 | \n", "1.0 | \n", "558880.0 | \n", "... | \n", "https://p.scdn.co/mp3-preview/32be593c0eb82868... | \n", "0.9430 | \n", "81.260 | \n", "4.0 | \n", "https://api.spotify.com/v1/tracks/1Vo802A38tPF... | \n", "track_2 | \n", "2.0 | \n", "spotify:track:1Vo802A38tPFHmje1h91um | \n", "0.0906 | \n", "track | \n", "
5 rows × 32 columns
\n", "\n", " | artists_id | \n", "acousticness | \n", "danceability | \n", "disc_number | \n", "duration_ms | \n", "energy | \n", "href | \n", "id | \n", "instrumentalness | \n", "key | \n", "... | \n", "speechiness | \n", "tempo | \n", "time_signature | \n", "track_href | \n", "uri | \n", "valence | \n", "release_date | \n", "artists_name | \n", "genres | \n", "release_year | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "68WwJXWrpo1yVOOIZjLSeT | \n", "0.0268 | \n", "0.506 | \n", "1.0 | \n", "248777.0 | \n", "0.741 | \n", "https://api.spotify.com/v1/tracks/0UATU9OJxh4m... | \n", "0UATU9OJxh4m3fwDljdGZn | \n", "0.000027 | \n", "1.0 | \n", "... | \n", "0.0349 | \n", "94.042 | \n", "4.0 | \n", "https://api.spotify.com/v1/tracks/0UATU9OJxh4m... | \n", "0UATU9OJxh4m3fwDljdGZn | \n", "0.236 | \n", "2018-09-28 | \n", "Evalyn | \n", "[electropop, indie electro-pop, indie poptimis... | \n", "2018 | \n", "
1 | \n", "09xj0S68Y1OU1vHMCZAIvz | \n", "0.5050 | \n", "0.487 | \n", "1.0 | \n", "171573.0 | \n", "0.297 | \n", "https://api.spotify.com/v1/tracks/4JH1M62gVDND... | \n", "4JH1M62gVDNDhDAUiQB3Qv | \n", "0.000052 | \n", "11.0 | \n", "... | \n", "0.0915 | \n", "185.912 | \n", "3.0 | \n", "https://api.spotify.com/v1/tracks/4JH1M62gVDND... | \n", "4JH1M62gVDNDhDAUiQB3Qv | \n", "0.289 | \n", "2001-08-21 | \n", "Café Tacvba | \n", "[latin, latin alternative, latin rock, mexican... | \n", "2001 | \n", "
2 | \n", "6pSsE5y0uJMwYj83KrPyf9 | \n", "0.1330 | \n", "0.629 | \n", "1.0 | \n", "207396.0 | \n", "0.706 | \n", "https://api.spotify.com/v1/tracks/0h7Ld5CvgzaU... | \n", "0h7Ld5CvgzaUN1zA3tdyPq | \n", "0.000000 | \n", "1.0 | \n", "... | \n", "0.4360 | \n", "81.220 | \n", "4.0 | \n", "https://api.spotify.com/v1/tracks/0h7Ld5CvgzaU... | \n", "0h7Ld5CvgzaUN1zA3tdyPq | \n", "0.543 | \n", "2019-01-25 | \n", "Dawn Richard | \n", "[alternative r&b, deep pop r&b, escape room, h... | \n", "2019 | \n", "
3 | \n", "7slfeZO9LsJbWgpkIoXBUJ | \n", "0.4060 | \n", "0.590 | \n", "1.0 | \n", "279000.0 | \n", "0.597 | \n", "https://api.spotify.com/v1/tracks/4S1bYWrLOC8s... | \n", "4S1bYWrLOC8smuy8kJzxKQ | \n", "0.000023 | \n", "9.0 | \n", "... | \n", "0.0275 | \n", "121.051 | \n", "4.0 | \n", "https://api.spotify.com/v1/tracks/4S1bYWrLOC8s... | \n", "4S1bYWrLOC8smuy8kJzxKQ | \n", "0.466 | \n", "1995-09-12 | \n", "Ricky Martin | \n", "[dance pop, latin, latin pop, mexican pop, pop... | \n", "1995 | \n", "
4 | \n", "09hVIj6vWgoCDtT03h8ZCa | \n", "0.0316 | \n", "0.727 | \n", "1.0 | \n", "218773.0 | \n", "0.380 | \n", "https://api.spotify.com/v1/tracks/758mQT4zzlvB... | \n", "758mQT4zzlvBhy9PvNePwC | \n", "0.000000 | \n", "7.0 | \n", "... | \n", "0.3350 | \n", "92.050 | \n", "4.0 | \n", "https://api.spotify.com/v1/tracks/758mQT4zzlvB... | \n", "758mQT4zzlvBhy9PvNePwC | \n", "0.455 | \n", "1991-09-24 | \n", "A Tribe Called Quest | \n", "[alternative hip hop, conscious hip hop, east ... | \n", "1991 | \n", "
5 rows × 28 columns
\n", "\n", " | Unnamed: 0 | \n", "acousticness | \n", "danceability | \n", "disc_number | \n", "duration_ms | \n", "energy | \n", "instrumentalness | \n", "key | \n", "liveness | \n", "loudness | \n", "mode | \n", "popularity | \n", "speechiness | \n", "tempo | \n", "time_signature | \n", "track_number | \n", "valence | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
count | \n", "101939.000000 | \n", "101939.000000 | \n", "101939.000000 | \n", "101939.000000 | \n", "1.019390e+05 | \n", "101939.000000 | \n", "101939.000000 | \n", "101939.000000 | \n", "101939.000000 | \n", "101939.000000 | \n", "101939.000000 | \n", "101939.000000 | \n", "101939.000000 | \n", "101939.000000 | \n", "101939.000000 | \n", "101939.000000 | \n", "101939.000000 | \n", "
mean | \n", "50969.000000 | \n", "0.352124 | \n", "0.586015 | \n", "1.032166 | \n", "2.467708e+05 | \n", "0.586479 | \n", "0.148776 | \n", "5.270858 | \n", "0.197640 | \n", "-9.462720 | \n", "0.618154 | \n", "39.782311 | \n", "0.128841 | \n", "118.358527 | \n", "3.875651 | \n", "4.608060 | \n", "0.482813 | \n", "
std | \n", "29427.398883 | \n", "0.334855 | \n", "0.177724 | \n", "0.566789 | \n", "1.904303e+05 | \n", "0.260170 | \n", "0.304024 | \n", "3.577679 | \n", "0.175391 | \n", "6.198508 | \n", "0.485841 | \n", "16.790769 | \n", "0.203324 | \n", "30.224074 | \n", "0.517008 | \n", "7.181805 | \n", "0.261690 | \n", "
min | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "1.000000 | \n", "1.155000e+03 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "-60.000000 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "1.000000 | \n", "0.000000 | \n", "
25% | \n", "25484.500000 | \n", "0.040700 | \n", "0.480000 | \n", "1.000000 | \n", "1.840000e+05 | \n", "0.411000 | \n", "0.000000 | \n", "2.000000 | \n", "0.095600 | \n", "-11.149000 | \n", "0.000000 | \n", "29.000000 | \n", "0.036400 | \n", "95.973000 | \n", "4.000000 | \n", "1.000000 | \n", "0.271000 | \n", "
50% | \n", "50969.000000 | \n", "0.238000 | \n", "0.610000 | \n", "1.000000 | \n", "2.168930e+05 | \n", "0.629000 | \n", "0.000037 | \n", "5.000000 | \n", "0.124000 | \n", "-7.599000 | \n", "1.000000 | \n", "41.000000 | \n", "0.050600 | \n", "118.067000 | \n", "4.000000 | \n", "2.000000 | \n", "0.477000 | \n", "
75% | \n", "76453.500000 | \n", "0.645000 | \n", "0.714000 | \n", "1.000000 | \n", "2.610550e+05 | \n", "0.798000 | \n", "0.034400 | \n", "8.000000 | \n", "0.241000 | \n", "-5.509000 | \n", "1.000000 | \n", "52.000000 | \n", "0.104000 | \n", "136.045000 | \n", "4.000000 | \n", "6.000000 | \n", "0.693000 | \n", "
max | \n", "101938.000000 | \n", "0.996000 | \n", "0.989000 | \n", "81.000000 | \n", "5.505831e+06 | \n", "1.000000 | \n", "1.000000 | \n", "11.000000 | \n", "0.999000 | \n", "2.719000 | \n", "1.000000 | \n", "97.000000 | \n", "0.969000 | \n", "244.035000 | \n", "5.000000 | \n", "655.000000 | \n", "0.993000 | \n", "