You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ML-For-Beginners/Clustering/1-Visualize/solution/notebook.ipynb

436 lines
787 KiB

4 years ago
{
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
},
"orig_nbformat": 2,
"kernelspec": {
"name": "python37364bit8d3b438fb5fc4430a93ac2cb74d693a7",
"display_name": "Python 3.7.0 64-bit ('3.7')"
},
"metadata": {
"interpreter": {
"hash": "70b38d7a306a849643e446cd70466270a13445e5987dfa1344ef2b127438fa4d"
}
}
},
"nbformat": 4,
"nbformat_minor": 2,
"cells": [
{
"source": [
"# Nigerian Music scraped from Spotify - an analysis"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Requirement already satisfied: seaborn in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (0.11.1)\n",
"Requirement already satisfied: pandas>=0.23 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from seaborn) (1.1.2)\n",
"Requirement already satisfied: matplotlib>=2.2 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from seaborn) (3.1.0)\n",
"Requirement already satisfied: numpy>=1.15 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from seaborn) (1.19.2)\n",
"Requirement already satisfied: scipy>=1.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from seaborn) (1.4.1)\n",
"Requirement already satisfied: python-dateutil>=2.7.3 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from pandas>=0.23->seaborn) (2.8.0)\n",
"Requirement already satisfied: pytz>=2017.2 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from pandas>=0.23->seaborn) (2019.1)\n",
"Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib>=2.2->seaborn) (2.4.0)\n",
"Requirement already satisfied: cycler>=0.10 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib>=2.2->seaborn) (0.10.0)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib>=2.2->seaborn) (1.1.0)\n",
"Requirement already satisfied: six>=1.5 in /Users/jenlooper/Library/Python/3.7/lib/python/site-packages (from python-dateutil>=2.7.3->pandas>=0.23->seaborn) (1.12.0)\n",
"Requirement already satisfied: setuptools in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from kiwisolver>=1.0.1->matplotlib>=2.2->seaborn) (45.1.0)\n",
"\u001b[33mWARNING: You are using pip version 20.2.3; however, version 21.1.1 is available.\n",
"You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -m pip install --upgrade pip' command.\u001b[0m\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"pip install seaborn"
]
},
{
"cell_type": "code",
"execution_count": 8,
4 years ago
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" name album \\\n",
"0 Sparky Mandy & The Jungle \n",
"1 shuga rush EVERYTHING YOU HEARD IS TRUE \n",
"2 LITT! LITT! \n",
"3 Confident / Feeling Cool Enjoy Your Life \n",
"4 wanted you rare. \n",
"\n",
" artist artist_top_genre release_date length popularity \\\n",
"0 Cruel Santino alternative r&b 2019 144000 48 \n",
"1 Odunsi (The Engine) afropop 2020 89488 30 \n",
"2 AYLØ indie r&b 2018 207758 40 \n",
"3 Lady Donli nigerian pop 2019 175135 14 \n",
"4 Odunsi (The Engine) afropop 2018 152049 25 \n",
"\n",
" danceability acousticness energy instrumentalness liveness loudness \\\n",
"0 0.666 0.8510 0.420 0.534000 0.1100 -6.699 \n",
"1 0.710 0.0822 0.683 0.000169 0.1010 -5.640 \n",
"2 0.836 0.2720 0.564 0.000537 0.1100 -7.127 \n",
"3 0.894 0.7980 0.611 0.000187 0.0964 -4.961 \n",
"4 0.702 0.1160 0.833 0.910000 0.3480 -6.044 \n",
"\n",
" speechiness tempo time_signature \n",
"0 0.0829 133.015 5 \n",
"1 0.3600 129.993 3 \n",
"2 0.0424 130.005 4 \n",
"3 0.1130 111.087 4 \n",
"4 0.0447 105.115 4 "
],
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>name</th>\n <th>album</th>\n <th>artist</th>\n <th>artist_top_genre</th>\n <th>release_date</th>\n <th>length</th>\n <th>popularity</th>\n <th>danceability</th>\n <th>acousticness</th>\n <th>energy</th>\n <th>instrumentalness</th>\n <th>liveness</th>\n <th>loudness</th>\n <th>speechiness</th>\n <th>tempo</th>\n <th>time_signature</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>Sparky</td>\n <td>Mandy &amp; The Jungle</td>\n <td>Cruel Santino</td>\n <td>alternative r&amp;b</td>\n <td>2019</td>\n <td>144000</td>\n <td>48</td>\n <td>0.666</td>\n <td>0.8510</td>\n <td>0.420</td>\n <td>0.534000</td>\n <td>0.1100</td>\n <td>-6.699</td>\n <td>0.0829</td>\n <td>133.015</td>\n <td>5</td>\n </tr>\n <tr>\n <th>1</th>\n <td>shuga rush</td>\n <td>EVERYTHING YOU HEARD IS TRUE</td>\n <td>Odunsi (The Engine)</td>\n <td>afropop</td>\n <td>2020</td>\n <td>89488</td>\n <td>30</td>\n <td>0.710</td>\n <td>0.0822</td>\n <td>0.683</td>\n <td>0.000169</td>\n <td>0.1010</td>\n <td>-5.640</td>\n <td>0.3600</td>\n <td>129.993</td>\n <td>3</td>\n </tr>\n <tr>\n <th>2</th>\n <td>LITT!</td>\n <td>LITT!</td>\n <td>AYLØ</td>\n <td>indie r&amp;b</td>\n <td>2018</td>\n <td>207758</td>\n <td>40</td>\n <td>0.836</td>\n <td>0.2720</td>\n <td>0.564</td>\n <td>0.000537</td>\n <td>0.1100</td>\n <td>-7.127</td>\n <td>0.0424</td>\n <td>130.005</td>\n <td>4</td>\n </tr>\n <tr>\n <th>3</th>\n <td>Confident / Feeling Cool</td>\n <td>Enjoy Your Life</td>\n <td>Lady Donli</td>\n <td>nigerian pop</td>\n <td>2019</td>\n <td>175135</td>\n <td>14</td>\n <td>0.894</td>\n <td>0.7980</td>\n <td>0.611</td>\n <td>0.000187</td>\n <td>0.0964</td>\n <td>-4.961</td>\n <td>0.1130</td>\n <td>111.087</td>\n <td>4</td>\n </tr>\n <tr>\n <th>4</th>\n <td>wanted you</td>\n <td>rare.</td>\n <td>Odunsi (The Engine)</td>\n <td>afropop</td>\n <td>2018</td>\n <td>152049</td>\n <td>25</td>\n <td>0.702</td>\n <td>0.1160</td>\n <td>0.833</td>\n <td>0.910000</td>\n <td>0.3480</td>\n <td>-6.044</td>\n <td>0.0447</td>\n <td>105.115</td>\n <td>4</td>\n </tr>\n </tbody>\n</table>\n</div>"
},
"metadata": {},
"execution_count": 8
4 years ago
}
],
"source": [
"\n",
"import matplotlib.pyplot as plt\n",
"import pandas as pd\n",
"\n",
"df = pd.read_csv(\"../../data/nigerian-songs.csv\")\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 9,
4 years ago
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 530 entries, 0 to 529\nData columns (total 16 columns):\n # Column Non-Null Count Dtype \n--- ------ -------------- ----- \n 0 name 530 non-null object \n 1 album 530 non-null object \n 2 artist 530 non-null object \n 3 artist_top_genre 530 non-null object \n 4 release_date 530 non-null int64 \n 5 length 530 non-null int64 \n 6 popularity 530 non-null int64 \n 7 danceability 530 non-null float64\n 8 acousticness 530 non-null float64\n 9 energy 530 non-null float64\n 10 instrumentalness 530 non-null float64\n 11 liveness 530 non-null float64\n 12 loudness 530 non-null float64\n 13 speechiness 530 non-null float64\n 14 tempo 530 non-null float64\n 15 time_signature 530 non-null int64 \ndtypes: float64(8), int64(4), object(4)\nmemory usage: 66.4+ KB\n"
]
}
],
"source": [
"df.info()"
]
},
{
"cell_type": "code",
"execution_count": 10,
4 years ago
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"name 0\n",
"album 0\n",
"artist 0\n",
"artist_top_genre 0\n",
"release_date 0\n",
"length 0\n",
"popularity 0\n",
"danceability 0\n",
"acousticness 0\n",
"energy 0\n",
"instrumentalness 0\n",
"liveness 0\n",
"loudness 0\n",
"speechiness 0\n",
"tempo 0\n",
"time_signature 0\n",
"dtype: int64"
]
},
"metadata": {},
"execution_count": 10
4 years ago
}
],
"source": [
"df.isnull().sum()"
]
},
{
"cell_type": "code",
"execution_count": 11,
4 years ago
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" release_date length popularity danceability acousticness \\\n",
"count 530.000000 530.000000 530.000000 530.000000 530.000000 \n",
"mean 2015.390566 222298.169811 17.507547 0.741619 0.265412 \n",
"std 3.131688 39696.822259 18.992212 0.117522 0.208342 \n",
"min 1998.000000 89488.000000 0.000000 0.255000 0.000665 \n",
"25% 2014.000000 199305.000000 0.000000 0.681000 0.089525 \n",
"50% 2016.000000 218509.000000 13.000000 0.761000 0.220500 \n",
"75% 2017.000000 242098.500000 31.000000 0.829500 0.403000 \n",
"max 2020.000000 511738.000000 73.000000 0.966000 0.954000 \n",
"\n",
" energy instrumentalness liveness loudness speechiness \\\n",
"count 530.000000 530.000000 530.000000 530.000000 530.000000 \n",
"mean 0.760623 0.016305 0.147308 -4.953011 0.130748 \n",
"std 0.148533 0.090321 0.123588 2.464186 0.092939 \n",
"min 0.111000 0.000000 0.028300 -19.362000 0.027800 \n",
"25% 0.669000 0.000000 0.075650 -6.298750 0.059100 \n",
"50% 0.784500 0.000004 0.103500 -4.558500 0.097950 \n",
"75% 0.875750 0.000234 0.164000 -3.331000 0.177000 \n",
"max 0.995000 0.910000 0.811000 0.582000 0.514000 \n",
"\n",
" tempo time_signature \n",
"count 530.000000 530.000000 \n",
"mean 116.487864 3.986792 \n",
"std 23.518601 0.333701 \n",
"min 61.695000 3.000000 \n",
"25% 102.961250 4.000000 \n",
"50% 112.714500 4.000000 \n",
"75% 125.039250 4.000000 \n",
"max 206.007000 5.000000 "
],
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>release_date</th>\n <th>length</th>\n <th>popularity</th>\n <th>danceability</th>\n <th>acousticness</th>\n <th>energy</th>\n <th>instrumentalness</th>\n <th>liveness</th>\n <th>loudness</th>\n <th>speechiness</th>\n <th>tempo</th>\n <th>time_signature</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>count</th>\n <td>530.000000</td>\n <td>530.000000</td>\n <td>530.000000</td>\n <td>530.000000</td>\n <td>530.000000</td>\n <td>530.000000</td>\n <td>530.000000</td>\n <td>530.000000</td>\n <td>530.000000</td>\n <td>530.000000</td>\n <td>530.000000</td>\n <td>530.000000</td>\n </tr>\n <tr>\n <th>mean</th>\n <td>2015.390566</td>\n <td>222298.169811</td>\n <td>17.507547</td>\n <td>0.741619</td>\n <td>0.265412</td>\n <td>0.760623</td>\n <td>0.016305</td>\n <td>0.147308</td>\n <td>-4.953011</td>\n <td>0.130748</td>\n <td>116.487864</td>\n <td>3.986792</td>\n </tr>\n <tr>\n <th>std</th>\n <td>3.131688</td>\n <td>39696.822259</td>\n <td>18.992212</td>\n <td>0.117522</td>\n <td>0.208342</td>\n <td>0.148533</td>\n <td>0.090321</td>\n <td>0.123588</td>\n <td>2.464186</td>\n <td>0.092939</td>\n <td>23.518601</td>\n <td>0.333701</td>\n </tr>\n <tr>\n <th>min</th>\n <td>1998.000000</td>\n <td>89488.000000</td>\n <td>0.000000</td>\n <td>0.255000</td>\n <td>0.000665</td>\n <td>0.111000</td>\n <td>0.000000</td>\n <td>0.028300</td>\n <td>-19.362000</td>\n <td>0.027800</td>\n <td>61.695000</td>\n <td>3.000000</td>\n </tr>\n <tr>\n <th>25%</th>\n <td>2014.000000</td>\n <td>199305.000000</td>\n <td>0.000000</td>\n <td>0.681000</td>\n <td>0.089525</td>\n <td>0.669000</td>\n <td>0.000000</td>\n <td>0.075650</td>\n <td>-6.298750</td>\n <td>0.059100</td>\n <td>102.961250</td>\n <td>4.000000</td>\n </tr>\n <tr>\n <th>50%</th>\n <td>2016.000000</td>\n <td>218509.000000</td>\n <td>13.000000</td>\n <td>0.761000</td>\n <td>0.220500</td>\n <td>0.784500</td>\n <td>0.000004</td>\n <td>0.103500</td>\n <td>-4.558500</td>\n <td>0.097950</td>\n <td>112.714500</td>\n <td>4.000000</td>\n </tr>\n <tr>\n <th>75%</th>\n <td>2017.000000</td>\n <td>242098.500000</td>\n <td>31.000000</td>\n <td>0.829500</td>\n <td>0.403000</td>\n <td>0.875750</td>\n <td>0.000234</td>\n <td>0.164000</td>\n <td>-3.331000</td>\n <td>0.177000</td>\n <td>125.039250</td>\n <td>4.000000</td>\n </tr>\n <tr>\n <th>max</th>\n <td>2020.000000</td>\n <td>511738.000000</td>\n <td>73.000000</td>\n <td>0.966000</td>\n <td>0.954000</td>\n <td>0.995000</td>\n <td>0.910000</td>\n <td>0.811000</td>\n <td>0.582000</td>\n <td>0.514000</td>\n <td>206.007000</td>\n <td>5.000000</td>\n </tr>\n </tbody>\n</table>\n</div>"
},
"metadata": {},
"execution_count": 11
4 years ago
}
],
"source": [
"df.describe()"
]
},
{
"cell_type": "code",
"execution_count": 13,
4 years ago
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"Text(0.5, 1.0, 'Top genres')"
]
},
"metadata": {},
"execution_count": 13
4 years ago
},
{
"output_type": "display_data",
"data": {
"text/plain": "<Figure size 720x504 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"474.468454pt\" version=\"1.1\" viewBox=\"0 0 598.4875 474.468454\" width=\"598.4875pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <defs>\n <style type=\"text/css\">\n*{stroke-linecap:butt;stroke-linejoin:round;white-space:pre;}\n </style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 474.468454 \nL 598.4875 474.468454 \nL 598.4875 0 \nL 0 0 \nz\n\" style=\"fill:none;\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 33.2875 402.838125 \nL 591.2875 402.838125 \nL 591.2875 22.318125 \nL 33.2875 22.318125 \nz\n\" style=\"fill:#ffffff;\"/>\n </g>\n <g id=\"patch_3\">\n <path clip-path=\"url(#p2fec5e84bb)\" d=\"M 44.4475 402.838125 \nL 133.7275 402.838125 \nL 133.7275 40.438125 \nL 44.4475 40.438125 \nz\n\" style=\"fill:#3274a1;\"/>\n </g>\n <g id=\"patch_4\">\n <path clip-path=\"url(#p2fec5e84bb)\" d=\"M 156.0475 402.838125 \nL 245.3275 402.838125 \nL 245.3275 303.399101 \nL 156.0475 303.399101 \nz\n\" style=\"fill:#e1812c;\"/>\n </g>\n <g id=\"patch_5\">\n <path clip-path=\"url(#p2fec5e84bb)\" d=\"M 267.6475 402.838125 \nL 356.9275 402.838125 \nL 356.9275 344.279588 \nL 267.6475 344.279588 \nz\n\" style=\"fill:#3a923a;\"/>\n </g>\n <g id=\"patch_6\">\n <path clip-path=\"url(#p2fec5e84bb)\" d=\"M 379.2475 402.838125 \nL 468.5275 402.838125 \nL 468.5275 376.321052 \nL 379.2475 376.321052 \nz\n\" style=\"fill:#c03d3e;\"/>\n </g>\n <g id=\"patch_7\">\n <path clip-path=\"url(#p2fec5e84bb)\" d=\"M 490.8475 402.838125 \nL 580.1275 402.838125 \nL 580.1275 393.999101 \nL 490.8475 393.999101 \nz\n\" style=\"fill:#9372b2;\"/>\n </g>\n <g id=\"matplotlib.axis_1\">\n <g id=\"xtick_1\">\n <g id=\"line2d_1\">\n <defs>\n <path d=\"M 0 0 \nL 0 3.5 \n\" id=\"m1e9e2598d8\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n </defs>\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"89.0875\" xlink:href=\"#m1e9e2598d8\" y=\"402.838125\"/>\n </g>\n </g>\n <g id=\"text_1\">\n <!-- afro dancehall -->\n <defs>\n <path d=\"M 34.28125 27.484375 \nQ 23.390625 27.484375 19.1875 25 \nQ 14.984375 22.515625 14.984375 16.5 \nQ 14.984375 11.71875 18.140625 8.90625 \nQ 21.296875 6.109375 26.703125 6.109375 \nQ 34.1875 6.109375 38.703125 11.40625 \nQ 43.21875 16.703125 43.21875 25.484375 \nL 43.21875 27.484375 \nz\nM 52.203125 31.203125 \nL 52.203125 0 \nL 43.21875 0 \nL 43.21875 8.296875 \nQ 40.140625 3.328125 35.546875 0.953125 \nQ 30.953125 -1.421875 24.3125 -1.421875 \nQ 15.921875 -1.421875 10.953125 3.296875 \nQ 6 8.015625 6 15.921875 \nQ 6 25.140625 12.171875 29.828125 \nQ 18.359375 34.515625 30.609375 34.515625 \nL 43.21875 34.515625 \nL 43.21875 35.40625 \nQ 43.21875 41.609375 39.140625 45 \nQ 35.0625 48.390625 27.6875 48.390625 \nQ 23 48.390625 18.546875 47.265625 \nQ 14.109375 46.140625 10.015625 43.890625 \nL 10.015625 52.203125 \nQ 14.9375 54.109375 19.578125 55.046875 \nQ 24.21875 56 28.609375 56 \nQ 40.484375 56 46.34375 49.84375 \nQ 52.203125 43.703125 52.203125 31.203125 \nz\n\" id=\"DejaVuSans-97\"/>\n <path d=\"M 37.109375 75.984375 \nL 37.109375 68.5 \nL 28.515625 68.5 \nQ 23.6875 68.5 21.796875 66.546875 \nQ 19.921875 64.59375 19.921875 59.515625 \nL 19.921875 54.6875 \nL 34.71875 54.6875 \nL 34.71875 47.703125 \nL 19.921875 47.703125 \nL 19.921875 0 \nL 10.890625 0 \nL 10.890625 47.703125 \nL 2.296875 47.703125 \nL 2.296875 54.6875 \nL 10.890625 54.6875 \nL 10.890625 58.5 \nQ 10.890625 67.625 15.140625 71.796875 \nQ 19.390625 75.984375 28.609375 75.984375 \nz\n\" id=\"DejaVuSans-102\"/>\n <path d=\"M 41.109375 46.296875 \nQ 39.59375 47.171875 37.8125 47.578125 \nQ 36.03125 48 33.890625 48 \nQ 26.265625 48 22.1875 43.046875 \nQ 18.109375 38.09375 18.109375 28.8125 \nL
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAHbCAYAAAAJY9SEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3de7zt9ZzH8de7TuWSUelIN3JpIrdwpBGKJiW6DZGUEBkVNXIbg8owg4bccyfGRK6Fxi3SaMalkqimcSTq6HKSQohTn/nj+9tj2XPq3L67tfbZr+fjcR5nrd/vt9b+1Dp7rff6XlNVSJIkadWtMe4CJEmSVhcG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InBitJkqRODFaSJEmdGKwkSZI6MVhJkiR1YrCSJEnqxGAlSZLUicFKkiSpE4OVJElSJ8sMVkk2T/L1JBckOT/J4cPxDZJ8JcmPhr/XH44nyVuTLExyXpIHz/R/hCRJ0iRYnharJcCRVbU1sB1waJKtgZcBp1XVlsBpw32AxwFbDn8OBo7vXrUkSdIEWmawqqrLq+qc4favgQuBTYE9gROGy04A9hpu7wl8uJpvAesl2bh75ZIkSRNmhcZYJdkCeBDwbWCjqrp8OHUFsNFwe1Pg0pGHXTYcm/5cByc5K8lZixcvXsGyJUmSJs9yB6sk6wKfAo6oql+NnquqAmpFfnBVvaeqFlTVgvnz56/IQyVJkibScgWrJGvRQtVHq+rTw+Erp7r4hr+vGo4vAjYfefhmwzFJkqTV2vLMCgzwfuDCqnrTyKlTgAOH2wcCJ48cf/owO3A74LqRLkNJkqTV1rzluGZ74ADgB0nOHY6
4 years ago
},
"metadata": {
"needs_background": "light"
}
4 years ago
}
],
"source": [
"import seaborn as sns\n",
"\n",
4 years ago
"top = df['artist_top_genre'].value_counts()\n",
"plt.figure(figsize=(10,7))\n",
"sns.barplot(x=top[:5].index,y=top[:5].values)\n",
"plt.xticks(rotation=45)\n",
"plt.title('Top genres',color = 'blue')"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": "<Figure size 864x648 with 2 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"601.100156pt\" version=\"1.1\" viewBox=\"0 0 686.52575 601.100156\" width=\"686.52575pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <defs>\n <style type=\"text/css\">\n*{stroke-linecap:butt;stroke-linejoin:round;white-space:pre;}\n </style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 601.100156 \nL 686.52575 601.100156 \nL 686.52575 0 \nL 0 0 \nz\n\" style=\"fill:none;\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 100.860938 500.239219 \nL 590.100937 500.239219 \nL 590.100937 10.999219 \nL 100.860938 10.999219 \nz\n\" style=\"fill:#ffffff;\"/>\n </g>\n <g id=\"QuadMesh_1\">\n <path clip-path=\"url(#p5615a9aa24)\" d=\"M 100.860938 10.999219 \nL 141.630938 10.999219 \nL 141.630938 51.769219 \nL 100.860938 51.769219 \nL 100.860938 10.999219 \n\" style=\"fill:#faebdd;\"/>\n <path clip-path=\"url(#p5615a9aa24)\" d=\"M 141.630938 10.999219 \nL 182.400937 10.999219 \nL 182.400937 51.769219 \nL 141.630938 51.769219 \nL 141.630938 10.999219 \n\" style=\"fill:#03051a;\"/>\n <path clip-path=\"url(#p5615a9aa24)\" d=\"M 182.400937 10.999219 \nL 223.170937 10.999219 \nL 223.170937 51.769219 \nL 182.400937 51.769219 \nL 182.400937 10.999219 \n\" style=\"fill:#cb1b4f;\"/>\n <path clip-path=\"url(#p5615a9aa24)\" d=\"M 223.170937 10.999219 \nL 263.940938 10.999219 \nL 263.940938 51.769219 \nL 223.170937 51.769219 \nL 223.170937 10.999219 \n\" style=\"fill:#971c5b;\"/>\n <path clip-path=\"url(#p5615a9aa24)\" d=\"M 263.940938 10.999219 \nL 304.710938 10.999219 \nL 304.710938 51.769219 \nL 263.940938 51.769219 \nL 263.940938 10.999219 \n\" style=\"fill:#b51657;\"/>\n <path clip-path=\"url(#p5615a9aa24)\" d=\"M 304.710938 10.999219 \nL 345.480937 10.999219 \nL 345.480937 51.769219 \nL 304.710938 51.769219 \nL 304.710938 10.999219 \n\" style=\"fill:#211330;\"/>\n <path clip-path=\"url(#p5615a9aa24)\" d=\"M 345.480937 10.999219 \nL 386.250937 10.999219 \nL 386.250937 51.769219 \nL 345.480937 51.769219 \nL 345.480937 10.999219 \n\" style=\"fill:#841e5a;\"/>\n <path clip-path=\"url(#p5615a9aa24)\" d=\"M 386.250937 10.999219 \nL 427.020937 10.999219 \nL 427.020937 51.769219 \nL 386.250937 51.769219 \nL 386.250937 10.999219 \n\" style=\"fill:#541e4e;\"/>\n <path clip-path=\"url(#p5615a9aa24)\" d=\"M 427.020937 10.999219 \nL 467.790937 10.999219 \nL 467.790937 51.769219 \nL 427.020937 51.769219 \nL 427.020937 10.999219 \n\" style=\"fill:#581e4f;\"/>\n <path clip-path=\"url(#p5615a9aa24)\" d=\"M 467.790937 10.999219 \nL 508.560937 10.999219 \nL 508.560937 51.769219 \nL 467.790937 51.769219 \nL 467.790937 10.999219 \n\" style=\"fill:#6b1f56;\"/>\n <path clip-path=\"url(#p5615a9aa24)\" d=\"M 508.560937 10.999219 \nL 549.330938 10.999219 \nL 549.330938 51.769219 \nL 508.560937 51.769219 \nL 508.560937 10.999219 \n\" style=\"fill:#6e1f57;\"/>\n <path clip-path=\"url(#p5615a9aa24)\" d=\"M 549.330938 10.999219 \nL 590.100937 10.999219 \nL 590.100937 51.769219 \nL 549.330938 51.769219 \nL 549.330938 10.999219 \n\" style=\"fill:#751f58;\"/>\n <path clip-path=\"url(#p5615a9aa24)\" d=\"M 100.860938 51.769219 \nL 141.630938 51.769219 \nL 141.630938 92.539219 \nL 100.860938 92.539219 \nL 100.860938 51.769219 \n\" style=\"fill:#03051a;\"/>\n <path clip-path=\"url(#p5615a9aa24)\" d=\"M 141.630938 51.769219 \nL 182.400937 51.769219 \nL 182.400937 92.539219 \nL 141.630938 92.539219 \nL 141.630938 51.769219 \n\" style=\"fill:#faebdd;\"/>\n <path clip-path=\"url(#p5615a9aa24)\" d=\"M 182.400937 51.769219 \nL 223.170937 51.769219 \nL 223.170937 92.539219 \nL 182.400937 92.539219 \nL 182.400937 51.769219 \n\" style=\"fill:#631f53;\"/>\n <path clip-path=\"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9DiDJkcCSZs4vgT2nWXOXlR2TJElaJfa4aoaem+StDD7D/wQOaTccSZKkdZuJ62pqHnV18siJkiRJa1uH+1Bnkz2ukiRJ6gUrrpIkSX1jxVWSJEnqLiuukiRJfTOmTxWw4ipJkqResOIqSZLUN/a4SpIkSd1lxVWSJKlv7HGVJEmSusuKqyRJUt/Y4ypJkiR1lxVXSZKkvrHHVZIkSb0wMTG72ypIsl+Sa5Jcm+TIlcx5cZKrklyZ5J/X9LKtuHbQBQ/Zs+0QpvVXC45oO4SRPrbkfW2HMNJHdz+q7RBGmrO87Qimd3huaTuEkf6EP2w7hJF+wrK2Qxjp5E26H+NmVNshTGvTHtSqdl6+QdshaBUlmQN8BHg2cBOwOMmpVXXV0JwdgbcCT66qXyV5yJqua+IqSZLUN+3fnLUXcG1VXQeQ5CTgAOCqoTmvBT5SVb8CqKqfr+mi3f/1S5IkSV2zDXDj0OubmrFhjwIeleS8JBck2W9NF7XiKkmS1Dc1u60pSRYCC4eGFlXVohmeZn1gR2Bv4OHAuUkeW1W3rm5cJq6SJEm6jyZJnS5R/TGw7dDrhzdjw24CvldVvwGuT/IDBons4tWNy1YBSZKkvmn/qQKLgR2TbJdkQ+AlwKmT5nyNQbWVJFsyaB24bk0u28RVkiRJM1JVy4A3AGcAVwNfrKork7wryf7NtDOAXyS5CjgbOLyqfrEm69oqIEmS1DftP1WAqjoNOG3S2FFD+wUc1mxrhRVXSZIk9YIVV0mSpL7xK18lSZKk7rLiKkmS1Dcd6HFtgxVXSZIk9YIVV0mSpL6Z5W/O6iorrpIkSeoFK66SJEl9Y4+rJEmS1F0mrpMkmZfkitV433eH3v+ytR+ZJElSY2JidreOMnFdQ0nWB6iqJzVD8wATV0mSpLWsd4lrU9H8fpIvJLk6ySl
},
"metadata": {
"needs_background": "light"
}
}
],
"source": [
"corrmat = df.corr()\n",
"f, ax = plt.subplots(figsize=(12, 9))\n",
"sns.heatmap(corrmat, vmax=.8, square=True);"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stderr",
"text": [
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/matplotlib/cbook/__init__.py:1402: FutureWarning: Support for multi-dimensional indexing (e.g. `obj[:, None]`) is deprecated and will be removed in a future version. Convert to a numpy array before indexing instead.\n x[:, None]\n/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/matplotlib/axes/_base.py:276: FutureWarning: Support for multi-dimensional indexing (e.g. `obj[:, None]`) is deprecated and will be removed in a future version. Convert to a numpy array before indexing instead.\n x = x[:, np.newaxis]\n/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/matplotlib/axes/_base.py:278: FutureWarning: Support for multi-dimensional indexing (e.g. `obj[:, None]`) is deprecated and will be removed in a future version. Convert to a numpy array before indexing instead.\n y = y[:, np.newaxis]\n/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/matplotlib/cbook/__init__.py:1402: FutureWarning: Support for multi-dimensional indexing (e.g. `obj[:, None]`) is deprecated and will be removed in a future version. Convert to a numpy array before indexing instead.\n x[:, None]\n/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/matplotlib/axes/_base.py:276: FutureWarning: Support for multi-dimensional indexing (e.g. `obj[:, None]`) is deprecated and will be removed in a future version. Convert to a numpy array before indexing instead.\n x = x[:, np.newaxis]\n/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/matplotlib/axes/_base.py:278: FutureWarning: Support for multi-dimensional indexing (e.g. `obj[:, None]`) is deprecated and will be removed in a future version. Convert to a numpy array before indexing instead.\n y = y[:, np.newaxis]\n"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": "<Figure size 432x432 with 3 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"421.607969pt\" version=\"1.1\" viewBox=\"0 0 421.338125 421.607969\" width=\"421.338125pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <defs>\n <style type=\"text/css\">\n*{stroke-linecap:butt;stroke-linejoin:round;white-space:pre;}\n </style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 421.607969 \nL 421.338125 421.607969 \nL 421.338125 0 \nL 0 0 \nz\n\" style=\"fill:#ffffff;\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 47.105 379.733125 \nL 351.218161 379.733125 \nL 351.218161 71.062821 \nL 47.105 71.062821 \nz\n\" style=\"fill:#ffffff;\"/>\n </g>\n <g id=\"matplotlib.axis_1\">\n <g id=\"xtick_1\">\n <g id=\"line2d_1\">\n <defs>\n <path d=\"M 0 0 \nL 0 6 \n\" id=\"m7464cc586d\" style=\"stroke:#262626;stroke-width:1.25;\"/>\n </defs>\n <g>\n <use style=\"fill:#262626;stroke:#262626;stroke-width:1.25;\" x=\"64.879791\" xlink:href=\"#m7464cc586d\" y=\"379.733125\"/>\n </g>\n </g>\n <g id=\"text_1\">\n <!-- 20 -->\n <defs>\n <path d=\"M 52.828125 31.203125 \nL 5.5625 31.203125 \nL 5.5625 39.40625 \nL 52.828125 39.40625 \nz\n\" id=\"ArialMT-8722\"/>\n <path d=\"M 50.34375 8.453125 \nL 50.34375 0 \nL 3.03125 0 \nQ 2.9375 3.171875 4.046875 6.109375 \nQ 5.859375 10.9375 9.828125 15.625 \nQ 13.8125 20.3125 21.34375 26.46875 \nQ 33.015625 36.03125 37.109375 41.625 \nQ 41.21875 47.21875 41.21875 52.203125 \nQ 41.21875 57.421875 37.46875 61 \nQ 33.734375 64.59375 27.734375 64.59375 \nQ 21.390625 64.59375 17.578125 60.78125 \nQ 13.765625 56.984375 13.71875 50.25 \nL 4.6875 51.171875 \nQ 5.609375 61.28125 11.65625 66.578125 \nQ 17.71875 71.875 27.9375 71.875 \nQ 38.234375 71.875 44.234375 66.15625 \nQ 50.25 60.453125 50.25 52 \nQ 50.25 47.703125 48.484375 43.546875 \nQ 46.734375 39.40625 42.65625 34.8125 \nQ 38.578125 30.21875 29.109375 22.21875 \nQ 21.1875 15.578125 18.9375 13.203125 \nQ 16.703125 10.84375 15.234375 8.453125 \nz\n\" id=\"ArialMT-50\"/>\n <path d=\"M 4.15625 35.296875 \nQ 4.15625 48 6.765625 55.734375 \nQ 9.375 63.484375 14.515625 67.671875 \nQ 19.671875 71.875 27.484375 71.875 \nQ 33.25 71.875 37.59375 69.546875 \nQ 41.9375 67.234375 44.765625 62.859375 \nQ 47.609375 58.5 49.21875 52.21875 \nQ 50.828125 45.953125 50.828125 35.296875 \nQ 50.828125 22.703125 48.234375 14.96875 \nQ 45.65625 7.234375 40.5 3 \nQ 35.359375 -1.21875 27.484375 -1.21875 \nQ 17.140625 -1.21875 11.234375 6.203125 \nQ 4.15625 15.140625 4.15625 35.296875 \nz\nM 13.1875 35.296875 \nQ 13.1875 17.671875 17.3125 11.828125 \nQ 21.4375 6 27.484375 6 \nQ 33.546875 6 37.671875 11.859375 \nQ 41.796875 17.71875 41.796875 35.296875 \nQ 41.796875 52.984375 37.671875 58.78125 \nQ 33.546875 64.59375 27.390625 64.59375 \nQ 21.34375 64.59375 17.71875 59.46875 \nQ 13.1875 52.9375 13.1875 35.296875 \nz\n\" id=\"ArialMT-48\"/>\n </defs>\n <g style=\"fill:#262626;\" transform=\"translate(55.550416 397.106719)scale(0.11 -0.11)\">\n <use xlink:href=\"#ArialMT-8722\"/>\n <use x=\"58.398438\" xlink:href=\"#ArialMT-50\"/>\n <use x=\"114.013672\" xlink:href=\"#ArialMT-48\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_2\">\n <g id=\"line2d_2\">\n <g>\n <use style=\"fill:#262626;stroke:#262626;stroke-width:1.25;\" x=\"112.413168\" xlink:href=\"#m7464cc586d\" y=\"379.733125\"/>\n </g>\n </g>\n <g id=\"text_2\">\n <!-- 0 -->\n <g style=\"fill:#262626;\" transform=\"translate(109.354652 397.106719)scale(0.11 -0.11)\">\n <use xlink:href=\"#ArialMT-48\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_3\">\n <g id=\"line2d_3\">\n <g>\n <use style=\"fill:#262626;stroke:#262626;stroke-width:1.25;\" x=\"159.946544\" xlink:href=\"#m7464cc58
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAaQAAAGkCAYAAAB+TFE1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nOzdd3xUVfr48c+U9Myk994IARJ6BxGwgQ2wLAqCvet+9WfBtaEurnVV0FVEV110cZFebBTpvSYhgZCE9J5MMn0y5f7+GIgioSeZBM779eJFmLm59wlJznPPuec8RyZJkoQgCIIguJjc1QEIgiAIAoiEJAiCIHQSIiEJgiAInYJISIIgCEKnIBKSIAiC0CmIhCQIgiB0CiIhCYIgCJ2C0tUBCBeuss7AzkNVlFbrkMtlJEX5MbhXOAEqT1eHJgiCcN5kYmFs12MwWflyRTbrdpfgkMDf1wOb3YHeZMVdKef6EYlMua47Hm4KV4cqCIJwzkRC6mLKanS8/uVOqhuM3DAigZuvSCI0wBtJkiip0rFkQz7r95QSE6bipXsHERns6+qQBUEQzolISF1IRa2eF/61BbtD4oXpg+iZGNTqcfuO1PDet3tRyGW89uBQEqP8OjhSQRCE8ycSUhehMzbz9IcbMZptvPnocOLC1Wc8vqxGx8tzt9NstfPWYyOICVN1UKSCIAgXRsyy6wIcDol35u+hrtHMy/cNPmsyAogOVTHr4WHI5TJenbedJr2lAyIVBEG4cCIhdQHLNxVwIK+WByem0z0u8Jw/L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egQOmPz8Wnpzr2kajTG439M1DWaWiZTnOCv8iBA5UGAyvP3j9WeBKg
},
"metadata": {}
}
],
"source": [
"sns.set_theme(style=\"ticks\")\n",
"\n",
"data = df[df['artist_top_genre'].str.contains('afro dancehall', case=True, regex=True)]\n",
"\n",
"# Show the joint distribution using kernel density estimation\n",
"g = sns.jointplot(\n",
" data=data,\n",
" x=\"popularity\", y=\"danceability\", hue=\"artist_top_genre\",\n",
" kind=\"kde\",\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f8952330e80>"
]
},
"metadata": {},
"execution_count": 27
},
{
"output_type": "display_data",
"data": {
"text/plain": "<Figure size 432x288 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"263.361181pt\" version=\"1.1\" viewBox=\"0 0 389.99456 263.361181\" width=\"389.99456pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <defs>\n <style type=\"text/css\">\n*{stroke-linecap:butt;stroke-linejoin:round;white-space:pre;}\n </style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 263.361181 \nL 389.99456 263.361181 \nL 389.99456 0 \nL 0 0 \nz\n\" style=\"fill:none;\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 43.78125 225.804931 \nL 378.58125 225.804931 \nL 378.58125 8.364931 \nL 43.78125 8.364931 \nz\n\" style=\"fill:#ffffff;\"/>\n </g>\n <g id=\"PathCollection_1\">\n <defs>\n <path d=\"M 0 2.236068 \nC 0.593012 2.236068 1.161816 2.000462 1.581139 1.581139 \nC 2.000462 1.161816 2.236068 0.593012 2.236068 0 \nC 2.236068 -0.593012 2.000462 -1.161816 1.581139 -1.581139 \nC 1.161816 -2.000462 0.593012 -2.236068 0 -2.236068 \nC -0.593012 -2.236068 -1.161816 -2.000462 -1.581139 -1.581139 \nC -2.000462 -1.161816 -2.236068 -0.593012 -2.236068 0 \nC -2.236068 0.593012 -2.000462 1.161816 -1.581139 1.581139 \nC -1.161816 2.000462 -0.593012 2.236068 0 2.236068 \nz\n\" id=\"md5ac5c95f3\" style=\"stroke:#1f77b4;\"/>\n </defs>\n <g clip-path=\"url(#p843c4be8cf)\">\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"234.501473\" xlink:href=\"#md5ac5c95f3\" y=\"41.241717\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"252.989578\" xlink:href=\"#md5ac5c95f3\" y=\"197.284891\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"305.932788\" xlink:href=\"#md5ac5c95f3\" y=\"158.761225\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"330.303472\" xlink:href=\"#md5ac5c95f3\" y=\"51.999116\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"249.628105\" xlink:href=\"#md5ac5c95f3\" y=\"190.424512\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"292.066709\" xlink:href=\"#md5ac5c95f3\" y=\"188.191844\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"298.369472\" xlink:href=\"#md5ac5c95f3\" y=\"122.226663\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"294.16763\" xlink:href=\"#md5ac5c95f3\" y=\"90.563376\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"310.13463\" xlink:href=\"#md5ac5c95f3\" y=\"170.533473\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"187.861027\" xlink:href=\"#md5ac5c95f3\" y=\"28.86056\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"263.494183\" xlink:href=\"#md5ac5c95f3\" y=\"36.979352\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"231.980368\" xlink:href=\"#md5ac5c95f3\" y=\"90.360406\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"208.029868\" xlink:href=\"#md5ac5c95f3\" y=\"69.048578\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"199.626184\" xlink:href=\"#md5ac5c95f3\" y=\"153.88995\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"233.240921\" xlink:href=\"#md5ac5c95f3\" y=\"37.182321\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"244.585894\" xlink:href=\"#md5ac5c95f3\" y=\"118.776176\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"179.457343\" xlink:href=\"#md5ac5c95f3\" y=\"114.91975\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"216.853737\" xlink:href=\"#md5ac5c95f3\" y=\"100.305926\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"268.956578\" xlink:href=\"#md5ac5c95f3\" y=\"90.563376\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"229.879447\" xlink:href=\"#md5ac5c95f3\" y=\"53.013965\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"254.250131\" xlink:href=\"#md5ac5c95f3\" y=\"179.261173\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b4;\" x=\"223.576684\" xlink:href=\"#md5ac5c95f3\" y=\"20.335829\"/>\n <use style=\"fill:#1f77b4;stroke:#1f77b
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEICAYAAABbOlNNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAL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F/oHHoxd+xJMvXM1B7sPrbLi0QigSCQP/Rb7NURYN/e8il5Lu8Lq7E4iIvSLGr7C3X7PrT7Phgj7u5zBCH7fxUtB1qOPpV4QkZeUUpOD7KtXDJqyoEMKg7FjdyfRiDi2GREBJcAhgRokqqecytgr5BQU3akkkBt+ahfqXak0qXSapHfxU8/v4nW+G5a1EhGz7IXuilddtGLQaAJSDkHc1rGHfQnnjDqVVkBxFUPLnVDmFXJqxy7cvZWIP0ET+qyqqYmktzLSVA4dlaSpGWqhAqkf5ahMumtfggUrN+dsv2V6E3fPnJgT1QN4Xo8wymd4BRHYsQt3v6Y5fsyb1hQooc+NIcKa196tyeehtxPo7orIXSIyREQaRORZEXlPRK4M8LkLRORPItIuIt/x2WeWiGwWkU0i8stiv4Cmd1DLJaHLJYi9BOrAmMGEUUOZMWk06+aexyNXT2Hd3PNQ4Hs9gtZfKgZ3yGk0Ag1Gbmlrv6Y5DYbQ4CFNrO9X6HzxaISo6/P7u1LMe2ITn7yjtp6HvkBQU9JnlVI3icgXgDeBLwLPA4/4fUBEDGAR8BlgB/CiiKxQSm227XMC8F1gqlJqt4h8pLSvoalnar3eUrkyewfGDBIugZpSKjsTt/w0ha5HWCHCXiGndtOZV9Mcu3O66aghXHT/Wrpszgb79yt0vnXt73PDslZHI57ObtPsdsOy1pp5HvoCQdeDlgK5GFimlNoT4DOfANqVUluVUl3Ar4FLXPt8A1iklNoNoJR6N+B4NL2IMGbA5aQ
},
"metadata": {
"needs_background": "light"
}
}
],
"source": [
"df.plot(kind=\"scatter\", x=\"danceability\", y=\"acousticness\")"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stderr",
"text": [
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/seaborn/axisgrid.py:316: UserWarning: The `size` parameter has been renamed to `height`; please update your code.\n warnings.warn(msg, UserWarning)\n"
]
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<seaborn.axisgrid.FacetGrid at 0x7f89608b7be0>"
]
},
"metadata": {},
"execution_count": 8
},
{
"output_type": "display_data",
"data": {
"text/plain": "<Figure size 495x360 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"352.073885pt\" version=\"1.1\" viewBox=\"0 0 475.428125 352.073885\" width=\"475.428125pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <defs>\n <style type=\"text/css\">\n*{stroke-linecap:butt;stroke-linejoin:round;white-space:pre;}\n </style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 352.073885 \nL 475.428125 352.073885 \nL 475.428125 0 \nL 0 0 \nz\n\" style=\"fill:none;\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 43.78125 314.517635 \nL 333.278125 314.517635 \nL 333.278125 7.496186 \nL 43.78125 7.496186 \nz\n\" style=\"fill:#ffffff;\"/>\n </g>\n <g id=\"PathCollection_1\">\n <defs>\n <path d=\"M 0 3 \nC 0.795609 3 1.55874 2.683901 2.12132 2.12132 \nC 2.683901 1.55874 3 0.795609 3 0 \nC 3 -0.795609 2.683901 -1.55874 2.12132 -2.12132 \nC 1.55874 -2.683901 0.795609 -3 0 -3 \nC -0.795609 -3 -1.55874 -2.683901 -2.12132 -2.12132 \nC -2.683901 -1.55874 -3 -0.795609 -3 0 \nC -3 0.795609 -2.683901 1.55874 -2.12132 2.12132 \nC -1.55874 2.683901 -0.795609 3 0 3 \nz\n\" id=\"m166dc198b2\" style=\"stroke:#f77189;\"/>\n </defs>\n <g clip-path=\"url(#pe072cf9c28)\">\n <use style=\"fill:#f77189;stroke:#f77189;\" x=\"208.25643\" xlink:href=\"#m166dc198b2\" y=\"53.744918\"/>\n <use style=\"fill:#f77189;stroke:#f77189;\" x=\"167.905923\" xlink:href=\"#m166dc198b2\" y=\"36.245001\"/>\n <use style=\"fill:#f77189;stroke:#f77189;\" x=\"233.339177\" xlink:href=\"#m166dc198b2\" y=\"47.720357\"/>\n <use style=\"fill:#f77189;stroke:#f77189;\" x=\"185.354791\" xlink:href=\"#m166dc198b2\" y=\"93.048011\"/>\n <use style=\"fill:#f77189;stroke:#f77189;\" x=\"207.165875\" xlink:href=\"#m166dc198b2\" y=\"48.00724\"/>\n <use style=\"fill:#f77189;stroke:#f77189;\" x=\"238.064912\" xlink:href=\"#m166dc198b2\" y=\"123.457703\"/>\n <use style=\"fill:#f77189;stroke:#f77189;\" x=\"276.234311\" xlink:href=\"#m166dc198b2\" y=\"226.44902\"/>\n </g>\n </g>\n <g id=\"PathCollection_2\">\n <defs>\n <path d=\"M 0 3 \nC 0.795609 3 1.55874 2.683901 2.12132 2.12132 \nC 2.683901 1.55874 3 0.795609 3 0 \nC 3 -0.795609 2.683901 -1.55874 2.12132 -2.12132 \nC 1.55874 -2.683901 0.795609 -3 0 -3 \nC -0.795609 -3 -1.55874 -2.683901 -2.12132 -2.12132 \nC -2.683901 -1.55874 -3 -0.795609 -3 0 \nC -3 0.795609 -2.683901 1.55874 -2.12132 2.12132 \nC -1.55874 2.683901 -0.795609 3 0 3 \nz\n\" id=\"m57db1167ad\" style=\"stroke:#f7764a;\"/>\n </defs>\n <g clip-path=\"url(#pe072cf9c28)\">\n <use style=\"fill:#f7764a;stroke:#f7764a;\" x=\"224.251225\" xlink:href=\"#m57db1167ad\" y=\"274.301253\"/>\n <use style=\"fill:#f7764a;stroke:#f7764a;\" x=\"221.343081\" xlink:href=\"#m57db1167ad\" y=\"264.604577\"/>\n <use style=\"fill:#f7764a;stroke:#f7764a;\" x=\"259.875997\" xlink:href=\"#m57db1167ad\" y=\"123.457703\"/>\n <use style=\"fill:#f7764a;stroke:#f7764a;\" x=\"206.075321\" xlink:href=\"#m57db1167ad\" y=\"123.17082\"/>\n <use style=\"fill:#f7764a;stroke:#f7764a;\" x=\"192.98867\" xlink:href=\"#m57db1167ad\" y=\"137.22813\"/>\n <use style=\"fill:#f7764a;stroke:#f7764a;\" x=\"225.34178\" xlink:href=\"#m57db1167ad\" y=\"248.825963\"/>\n <use style=\"fill:#f7764a;stroke:#f7764a;\" x=\"289.68448\" xlink:href=\"#m57db1167ad\" y=\"136.367478\"/>\n <use style=\"fill:#f7764a;stroke:#f7764a;\" x=\"242.427129\" xlink:href=\"#m57db1167ad\" y=\"232.186698\"/>\n <use style=\"fill:#f7764a;stroke:#f7764a;\" x=\"285.322263\" xlink:href=\"#m57db1167ad\" y=\"255.137409\"/>\n <use style=\"fill:#f7764a;stroke:#f7764a;\" x=\"231.158069\" xlink:href=\"#m57db1167ad\" y=\"117.720026\"/>\n <use style=\"fill:#f7764a;stroke:#f7764a;\" x=\"251.515081\" xlink:href=\"#m57db1167ad\" y=\"257.145596\"/>\n <use style=\"fill:#f7764a;stroke:#f7764a;
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAdsAAAFgCAYAAADzd9OCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nOydeZgU5bX/P2emhxnGYRVkURBQDIorICoq0egVQRPURI1LLsZclwRj/OVqtou5JiFXE7OZiKImBhLFRI0i0VESDYoBZXcDURQUVECRdYCZ6Z45vz+qeuilurt6qememfN5Hp7pfvutt96qGfrUOe95z1dUFcMwDMMwgqOs2BMwDMMwjPaOGVvDMAzDCBgztoZhGIYRMGZsDcMwDCNgzNgahmEYRsCYsTUMwzCMgAnM2IrI/SLysYi8keJzEZHfisg7IvKaiIzwM+7ZZ5+tgP2zf/bP/hXzn2FkRZ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1ue648A1zrStq9hYfsnqp+KiILROQN4Gl33fZw4CVXMrYOuBzHEPrlFuAREdkG/It9tY//DjwqIhNxQr2J/BVHS3ewO7dGEfkS8FsR6YZjk36DI06Qjp/ieNdviMhe4AUcIYNZIvJFt896HBnArsC1qlqfxfUVHKuNbBg5UMoygC/9+Rwa6jYltVfW9OWkrzzlcYSRAznVRnaTof4PJ3S8HvhB1a++M6uQEzNKE/NsDSMXSjhTuKFuc1btRuvhGlYzrh0QW7M1jFwo4Uzhypo+WbUbhhE8ZmwNIwdKOVN4yAnXURaKTw4tC1Ux5ITrijQjwzAsjGwYOVDKAvfRJKi1i+6koW4zlTV9GHLCdZY
},
"metadata": {
"needs_background": "light"
}
}
],
"source": [
"import seaborn as sns\n",
"\n",
"sns.FacetGrid(df, hue=\"artist_top_genre\", size=5) \\\n",
" .map(plt.scatter, \"danceability\", \"acousticness\") \\\n",
" .add_legend()"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stderr",
"text": [
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/seaborn/categorical.py:1296: UserWarning: 14.3% of the points cannot be placed; you may want to decrease the size of the markers or use stripplot.\n warnings.warn(msg, UserWarning)\n/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/seaborn/categorical.py:1296: UserWarning: 53.3% of the points cannot be placed; you may want to decrease the size of the markers or use stripplot.\n warnings.warn(msg, UserWarning)\n/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/seaborn/categorical.py:1296: UserWarning: 16.7% of the points cannot be placed; you may want to decrease the size of the markers or use stripplot.\n warnings.warn(msg, UserWarning)\n/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/seaborn/categorical.py:1296: UserWarning: 79.9% of the points cannot be placed; you may want to decrease the size of the markers or use stripplot.\n warnings.warn(msg, UserWarning)\n/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/seaborn/categorical.py:1296: UserWarning: 41.5% of the points cannot be placed; you may want to decrease the size of the markers or use stripplot.\n warnings.warn(msg, UserWarning)\n/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/seaborn/categorical.py:1296: UserWarning: 25.0% of the points cannot be placed; you may want to decrease the size of the markers or use stripplot.\n warnings.warn(msg, UserWarning)\n"
]
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f8932b653c8>"
]
},
"metadata": {},
"execution_count": 36
},
{
"output_type": "display_data",
"data": {
"text/plain": "<Figure size 432x288 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"262.19625pt\" version=\"1.1\" viewBox=\"0 0 473.696249 262.19625\" width=\"473.696249pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <defs>\n <style type=\"text/css\">\n*{stroke-linecap:butt;stroke-linejoin:round;white-space:pre;}\n </style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 262.19625 \nL 473.696249 262.19625 \nL 473.696249 0 \nL 0 0 \nz\n\" style=\"fill:none;\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 127.09375 224.64 \nL 461.89375 224.64 \nL 461.89375 7.2 \nL 127.09375 7.2 \nz\n\" style=\"fill:#ffffff;\"/>\n </g>\n <g id=\"matplotlib.axis_1\">\n <g id=\"xtick_1\">\n <g id=\"line2d_1\">\n <defs>\n <path d=\"M 0 0 \nL 0 3.5 \n\" id=\"m9acbada794\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n </defs>\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.003812\" xlink:href=\"#m9acbada794\" y=\"224.64\"/>\n </g>\n </g>\n <g id=\"text_1\">\n <!-- 0.3 -->\n <defs>\n <path d=\"M 31.78125 66.40625 \nQ 24.171875 66.40625 20.328125 58.90625 \nQ 16.5 51.421875 16.5 36.375 \nQ 16.5 21.390625 20.328125 13.890625 \nQ 24.171875 6.390625 31.78125 6.390625 \nQ 39.453125 6.390625 43.28125 13.890625 \nQ 47.125 21.390625 47.125 36.375 \nQ 47.125 51.421875 43.28125 58.90625 \nQ 39.453125 66.40625 31.78125 66.40625 \nz\nM 31.78125 74.21875 \nQ 44.046875 74.21875 50.515625 64.515625 \nQ 56.984375 54.828125 56.984375 36.375 \nQ 56.984375 17.96875 50.515625 8.265625 \nQ 44.046875 -1.421875 31.78125 -1.421875 \nQ 19.53125 -1.421875 13.0625 8.265625 \nQ 6.59375 17.96875 6.59375 36.375 \nQ 6.59375 54.828125 13.0625 64.515625 \nQ 19.53125 74.21875 31.78125 74.21875 \nz\n\" id=\"DejaVuSans-48\"/>\n <path d=\"M 10.6875 12.40625 \nL 21 12.40625 \nL 21 0 \nL 10.6875 0 \nz\n\" id=\"DejaVuSans-46\"/>\n <path d=\"M 40.578125 39.3125 \nQ 47.65625 37.796875 51.625 33 \nQ 55.609375 28.21875 55.609375 21.1875 \nQ 55.609375 10.40625 48.1875 4.484375 \nQ 40.765625 -1.421875 27.09375 -1.421875 \nQ 22.515625 -1.421875 17.65625 -0.515625 \nQ 12.796875 0.390625 7.625 2.203125 \nL 7.625 11.71875 \nQ 11.71875 9.328125 16.59375 8.109375 \nQ 21.484375 6.890625 26.8125 6.890625 \nQ 36.078125 6.890625 40.9375 10.546875 \nQ 45.796875 14.203125 45.796875 21.1875 \nQ 45.796875 27.640625 41.28125 31.265625 \nQ 36.765625 34.90625 28.71875 34.90625 \nL 20.21875 34.90625 \nL 20.21875 43.015625 \nL 29.109375 43.015625 \nQ 36.375 43.015625 40.234375 45.921875 \nQ 44.09375 48.828125 44.09375 54.296875 \nQ 44.09375 59.90625 40.109375 62.90625 \nQ 36.140625 65.921875 28.71875 65.921875 \nQ 24.65625 65.921875 20.015625 65.03125 \nQ 15.375 64.15625 9.8125 62.3125 \nL 9.8125 71.09375 \nQ 15.4375 72.65625 20.34375 73.4375 \nQ 25.25 74.21875 29.59375 74.21875 \nQ 40.828125 74.21875 47.359375 69.109375 \nQ 53.90625 64.015625 53.90625 55.328125 \nQ 53.90625 49.265625 50.4375 45.09375 \nQ 46.96875 40.921875 40.578125 39.3125 \nz\n\" id=\"DejaVuSans-51\"/>\n </defs>\n <g transform=\"translate(155.05225 239.238437)scale(0.1 -0.1)\">\n <use xlink:href=\"#DejaVuSans-48\"/>\n <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n <use x=\"95.410156\" xlink:href=\"#DejaVuSans-51\"/>\n </g>\n </g>\n </g>\n <g id=\"xtick_2\">\n <g id=\"line2d_2\">\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"205.223937\" xlink:href=\"#m9acbada794\" y=\"224.64\"/>\n </g>\n </g>\n <g id=\"text_2\">\n <!-- 0.4 -->\n <defs>\n <path d=\"M 37.796875 64.3125 \nL 12.890625 25.390625 \nL 37.796875 25.390625 \nz\nM 35.203125 72.90625 \nL 47.609375 72.90625 \nL 47.609375 25.390625 \nL 58.015625 25.390625 \nL 58.015625 17.1875 \nL 47.609375 17.1875 \nL 47.609375 0
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAdoAAAEGCAYAAADCGFT7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nOydd3gdxbn/P+/uOUe9WV1Wtdx7ww3bGMfUUEIJJIQEEkJu+k1yk9z7y00ICWlcci9pJJBCIIGA6QEMBAw22Ljg3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TtXoZSplfEI5ItujNCWmg+GaD9gUeYRvkBv5MFUMdKMUr3DVim/7YGf1bV3BCSoFAt56cile1ozwIi8nER2Sciq4bbFhsbAKNkR3CCx41x5CS/NM8CWnoOWvHkvgSnC33WJQOW0fubZkxOM6ePA3BcfHVfW2NCApSiY9HyRqPPvhQcfc5MiieDL2QvqQiOKfPRL1oalHcwtHEzcMy/AlwDbJ5IHIE+wZyp1IonB9WvjZqEY8GVEB3bZ8rIUUje6KAqjOojEauW/DE4LruF/hyxjBwFMXHhN9x9ISASE4c2ZW7/9vfmyylE8gYPqNLGTA1OiEtEcs5PMTx76vjscBdwt1JqbWBigKyijU2/eDeuNKdBdR3HvCvQp0beFebbvRHv+jfA60Gfvsj84rZQ7m68K5/DOLQLGZER8QtrKFNyyjDwvfcKvj0bkZg49EXXood+IQKqvQXvm8sxKg8hWfk4L7sVSRl4z7bq7sT71jMYZXuRtGwcyz6OlpFrteuDxBRwukwnu+g6tMy8AesTZ5R/PVbGz0LPLcI4VoZ
},
"metadata": {
"needs_background": "light"
}
}
],
"source": [
"sns.swarmplot(x=df['danceability'],\n",
" y=df['artist_top_genre'])"
]
},
4 years ago
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
]
}