{ "cells": [ { "cell_type": "markdown", "metadata": { "cell_id": "00dd38b5-5d55-49b4-86a5-f094fd84fded", "deepnote_cell_type": "markdown", "tags": [] }, "source": [ "# Spotify dataset\n", "\n", "[Recording of lecture from 1/24/2022](https://uci.zoom.us/rec/share/JBsBgWKEEa9fweZFzQH2J8SiWKWcVSDiMQx0dOt56nxRQ0b8dpW-Nj6-Hrp_ijkQ._1bDpwn5N2eTJ4u-?startTime=1643039871000)\n", "\n", "The csv file attached to this project was originally taken from this [Kaggle dataset](https://www.kaggle.com/sashankpillai/spotify-top-200-charts-20202021/version/1).\n", "\n", "To start out we want to plot Energy vs Loudness using Altair.\n", "\n", "To change the default colors, we can select a different [color scheme](https://vega.github.io/vega/docs/schemes/)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "cell_id": "09575021-3c29-4a89-97c6-8b95dd69d753", "deepnote_cell_type": "code", "deepnote_to_be_reexecuted": false, "execution_millis": 444, "execution_start": 1643039982296, "source_hash": "46e6bd77", "tags": [] }, "outputs": [], "source": [ "import pandas as pd\n", "import altair as alt" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "cell_id": "45fec56c-60e9-46af-bbfe-879d8823d22b", "deepnote_cell_type": "code", "deepnote_output_heights": [ 21.1875 ], "deepnote_to_be_reexecuted": false, "execution_millis": 3329, "execution_start": 1643040318436, "source_hash": "3f39c031", "tags": [] }, "outputs": [], "source": [ "df = pd.read_csv(\"../data/spotify_dataset.csv\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "cell_id": "c18ddc29-ba52-4dc4-b859-e7a46e74f3e8", "deepnote_cell_type": "code", "deepnote_output_heights": [ 212 ], "deepnote_to_be_reexecuted": false, "execution_millis": 25, "execution_start": 1643040323719, "source_hash": "c085b6ba", "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
IndexHighest Charting PositionNumber of Times ChartedWeek of Highest ChartingSong NameStreamsArtistArtist FollowersSong IDGenre...DanceabilityEnergyLoudnessSpeechinessAcousticnessLivenessTempoDuration (ms)ValenceChord
01182021-07-23--2021-07-30Beggin'48,633,449Måneskin33777623Wrjm47oTz2sjIgck11l5e['indie rock italiano', 'italian pop']...0.7140.8-4.8080.05040.1270.359134.0022115600.589B
12232021-07-23--2021-07-30STAY (with Justin Bieber)47,248,719The Kid LAROI22300225HCyWlXZPP0y6Gqq8TgA20['australian hip hop']...0.5910.764-5.4840.04830.03830.103169.9281418060.478C#/Db
231112021-06-25--2021-07-02good 4 u40,162,559Olivia Rodrigo62665144ZtFanR9U6ndgddUvNcjcG['pop']...0.5630.664-5.0440.1540.3350.0849166.9281781470.688A
34352021-07-02--2021-07-09Bad Habits37,799,456Ed Sheeran832933806PQ88X9TkUIAUIZJHW2upE['pop', 'uk pop']...0.8080.897-3.7120.03480.04690.364126.0262310410.591B
45512021-07-23--2021-07-30INDUSTRY BABY (feat. Jack Harlow)33,948,454Lil Nas X547356527NovPIUIRrOZoCHxABJwK['lgbtq+ hip hop', 'pop rap']...0.7360.704-7.4090.06150.02030.0501149.9952120000.894D#/Eb
\n", "

5 rows × 23 columns

\n", "
" ], "text/plain": [ " Index Highest Charting Position Number of Times Charted \\\n", "0 1 1 8 \n", "1 2 2 3 \n", "2 3 1 11 \n", "3 4 3 5 \n", "4 5 5 1 \n", "\n", " Week of Highest Charting Song Name Streams \\\n", "0 2021-07-23--2021-07-30 Beggin' 48,633,449 \n", "1 2021-07-23--2021-07-30 STAY (with Justin Bieber) 47,248,719 \n", "2 2021-06-25--2021-07-02 good 4 u 40,162,559 \n", "3 2021-07-02--2021-07-09 Bad Habits 37,799,456 \n", "4 2021-07-23--2021-07-30 INDUSTRY BABY (feat. Jack Harlow) 33,948,454 \n", "\n", " Artist Artist Followers Song ID \\\n", "0 Måneskin 3377762 3Wrjm47oTz2sjIgck11l5e \n", "1 The Kid LAROI 2230022 5HCyWlXZPP0y6Gqq8TgA20 \n", "2 Olivia Rodrigo 6266514 4ZtFanR9U6ndgddUvNcjcG \n", "3 Ed Sheeran 83293380 6PQ88X9TkUIAUIZJHW2upE \n", "4 Lil Nas X 5473565 27NovPIUIRrOZoCHxABJwK \n", "\n", " Genre ... Danceability Energy Loudness \\\n", "0 ['indie rock italiano', 'italian pop'] ... 0.714 0.8 -4.808 \n", "1 ['australian hip hop'] ... 0.591 0.764 -5.484 \n", "2 ['pop'] ... 0.563 0.664 -5.044 \n", "3 ['pop', 'uk pop'] ... 0.808 0.897 -3.712 \n", "4 ['lgbtq+ hip hop', 'pop rap'] ... 0.736 0.704 -7.409 \n", "\n", " Speechiness Acousticness Liveness Tempo Duration (ms) Valence Chord \n", "0 0.0504 0.127 0.359 134.002 211560 0.589 B \n", "1 0.0483 0.0383 0.103 169.928 141806 0.478 C#/Db \n", "2 0.154 0.335 0.0849 166.928 178147 0.688 A \n", "3 0.0348 0.0469 0.364 126.026 231041 0.591 B \n", "4 0.0615 0.0203 0.0501 149.995 212000 0.894 D#/Eb \n", "\n", "[5 rows x 23 columns]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.head()" ] }, { "cell_type": "markdown", "metadata": { "cell_id": "ad6a67f4-e8fe-4a08-b97d-a1078b93e74c", "deepnote_cell_type": "code", "deepnote_output_heights": [ 611 ], "deepnote_to_be_reexecuted": false, "execution_millis": 329, "execution_start": 1643040951193, "source_hash": "c88f7de2", "tags": [] }, "source": [ "If you try to make this into a chart directly with the following code, it does not work.\n", "\n", "```\n", "alt.Chart(df).mark_circle().encode(\n", " x = \"Energy\",\n", " y = \"Loudness\"\n", ")\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A first guess is that df is too long (Altair by default only works with DataFrames with 5000 rows or fewer)." ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "cell_id": "8d4a20b4-83e8-4b36-8f71-461c130e5e65", "deepnote_cell_type": "code", "deepnote_output_heights": [ 172 ], "deepnote_to_be_reexecuted": false, "execution_millis": 5, "execution_start": 1643040489578, "source_hash": "149a469d", "tags": [] }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "alt.Chart(df.iloc[:5]).mark_circle().encode(\n", " x = \"Energy\",\n", " y = \"Loudness\"\n", ")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "cell_id": "f3bcba66-46e0-4b2f-84db-e01ca8ea71cb", "deepnote_cell_type": "code", "deepnote_output_heights": [ 172 ], "deepnote_to_be_reexecuted": false, "execution_millis": 41, "execution_start": 1643040497528, "source_hash": "f074ce59", "tags": [] }, "outputs": [], "source": [ "alt.Chart(df[:5]).mark_circle().encode(\n", " x = \"Energy\",\n", " y = \"Loudness\"\n", ")" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "cell_id": "fc3747f2-a2ab-4f7d-b542-ff8b79016c19", "deepnote_cell_type": "code", "deepnote_output_heights": [ 21 ], "deepnote_to_be_reexecuted": false, "execution_millis": 8, "execution_start": 1643040548255, "source_hash": "312655ce", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "pandas.core.frame.DataFrame" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type(df.head())" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "cell_id": "bc535934-060a-492e-821b-dc72f5886515", "deepnote_cell_type": "code", "deepnote_to_be_reexecuted": false, "execution_millis": 4, "execution_start": 1643040616534, "source_hash": "de1e323c", "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 1556 entries, 0 to 1555\n", "Data columns (total 23 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Index 1556 non-null int64 \n", " 1 Highest Charting Position 1556 non-null int64 \n", " 2 Number of Times Charted 1556 non-null int64 \n", " 3 Week of Highest Charting 1556 non-null object\n", " 4 Song Name 1556 non-null object\n", " 5 Streams 1556 non-null object\n", " 6 Artist 1556 non-null object\n", " 7 Artist Followers 1556 non-null object\n", " 8 Song ID 1556 non-null object\n", " 9 Genre 1556 non-null object\n", " 10 Release Date 1556 non-null object\n", " 11 Weeks Charted 1556 non-null object\n", " 12 Popularity 1556 non-null object\n", " 13 Danceability 1556 non-null object\n", " 14 Energy 1556 non-null object\n", " 15 Loudness 1556 non-null object\n", " 16 Speechiness 1556 non-null object\n", " 17 Acousticness 1556 non-null object\n", " 18 Liveness 1556 non-null object\n", " 19 Tempo 1556 non-null object\n", " 20 Duration (ms) 1556 non-null object\n", " 21 Valence 1556 non-null object\n", " 22 Chord 1556 non-null object\n", "dtypes: int64(3), object(20)\n", "memory usage: 279.7+ KB\n" ] } ], "source": [ "df.info()" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "cell_id": "95ce09c2-68a0-4014-b3b5-e88c42a6d14e", "deepnote_cell_type": "code", "deepnote_output_heights": [ 232 ], "deepnote_to_be_reexecuted": false, "execution_millis": 5, "execution_start": 1643040648096, "source_hash": "1c66b0c1", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "Taylor Swift 52\n", "Lil Uzi Vert 32\n", "Justin Bieber 32\n", "Juice WRLD 30\n", "BTS 29\n", " ..\n", "Dadá Boladão, Tati Zaqui, OIK 1\n", "K/DA, Madison Beer, (G)I-DLE, Lexie Liu, Jaira Burns, Seraphine, League of Legends 1\n", "187 Strassenbande, Bonez MC, Frauenarzt 1\n", "SHAED, ZAYN 1\n", "Tiago PZK, LIT killah 1\n", "Name: Artist, Length: 716, dtype: int64" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.Artist.value_counts()" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "cell_id": "eacbb721-cc7c-4cdf-8d83-ecccd723126f", "deepnote_cell_type": "code", "deepnote_output_heights": [ 232 ], "deepnote_to_be_reexecuted": false, "execution_millis": 3, "execution_start": 1643040675584, "source_hash": "4374355f", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "Taylor Swift 52\n", "Lil Uzi Vert 32\n", "Justin Bieber 32\n", "Juice WRLD 30\n", "BTS 29\n", " ..\n", "Dadá Boladão, Tati Zaqui, OIK 1\n", "K/DA, Madison Beer, (G)I-DLE, Lexie Liu, Jaira Burns, Seraphine, League of Legends 1\n", "187 Strassenbande, Bonez MC, Frauenarzt 1\n", "SHAED, ZAYN 1\n", "Tiago PZK, LIT killah 1\n", "Name: Artist, Length: 716, dtype: int64" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df[\"Artist\"].value_counts()" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "cell_id": "a2ba1d5c-3400-4862-8ec7-57eba6deac3f", "deepnote_cell_type": "code", "deepnote_to_be_reexecuted": false, "execution_millis": 124, "execution_start": 1643040699684, "source_hash": "6d948350", "tags": [] }, "outputs": [ { "data": { "application/vnd.deepnote.dataframe.v3+json": { "column_count": 23, "columns": [ { "dtype": "int64", "name": "Index", "stats": { "histogram": [ { "bin_end": 1.2, "bin_start": 1, "count": 1 }, { "bin_end": 1.4, "bin_start": 1.2, "count": 0 }, { "bin_end": 1.6, "bin_start": 1.4, "count": 0 }, { "bin_end": 1.8, "bin_start": 1.6, "count": 0 }, { "bin_end": 2, "bin_start": 1.8, "count": 0 }, { "bin_end": 2.2, "bin_start": 2, "count": 1 }, { "bin_end": 2.4000000000000004, "bin_start": 2.2, "count": 0 }, { "bin_end": 2.6, "bin_start": 2.4000000000000004, "count": 0 }, { "bin_end": 2.8, "bin_start": 2.6, "count": 0 }, { "bin_end": 3, "bin_start": 2.8, "count": 1 } ], "max": "3", "min": "1", "nan_count": 0, "unique_count": 3 } }, { "dtype": "int64", "name": "Highest Charting Position", "stats": { "histogram": [ { "bin_end": 1.1, "bin_start": 1, "count": 2 }, { "bin_end": 1.2, "bin_start": 1.1, "count": 0 }, { "bin_end": 1.3, "bin_start": 1.2, "count": 0 }, { "bin_end": 1.4, "bin_start": 1.3, "count": 0 }, { "bin_end": 1.5, "bin_start": 1.4, "count": 0 }, { "bin_end": 1.6, "bin_start": 1.5, "count": 0 }, { "bin_end": 1.7000000000000002, "bin_start": 1.6, "count": 0 }, { "bin_end": 1.8, "bin_start": 1.7000000000000002, "count": 0 }, { "bin_end": 1.9, "bin_start": 1.8, "count": 0 }, { "bin_end": 2, "bin_start": 1.9, "count": 1 } ], "max": "2", "min": "1", "nan_count": 0, "unique_count": 2 } }, { "dtype": "int64", "name": "Number of Times Charted", "stats": { "histogram": [ { "bin_end": 3.8, "bin_start": 3, "count": 1 }, { "bin_end": 4.6, "bin_start": 3.8, "count": 0 }, { "bin_end": 5.4, "bin_start": 4.6, "count": 0 }, { "bin_end": 6.2, "bin_start": 5.4, "count": 0 }, { "bin_end": 7, "bin_start": 6.2, "count": 0 }, { "bin_end": 7.800000000000001, "bin_start": 7, "count": 0 }, { "bin_end": 8.600000000000001, "bin_start": 7.800000000000001, "count": 1 }, { "bin_end": 9.4, "bin_start": 8.600000000000001, "count": 0 }, { "bin_end": 10.2, "bin_start": 9.4, "count": 0 }, { "bin_end": 11, "bin_start": 10.2, "count": 1 } ], "max": "11", "min": "3", "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Week of Highest Charting", "stats": { "categories": [ { "count": 2, "name": "2021-07-23--2021-07-30" }, { "count": 1, "name": "2021-06-25--2021-07-02" } ], "nan_count": 0, "unique_count": 2 } }, { "dtype": "object", "name": "Song Name", "stats": { "categories": [ { "count": 1, "name": "Beggin'" }, { "count": 1, "name": "STAY (with Justin Bieber)" }, { "count": 1, "name": "good 4 u" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Streams", "stats": { "categories": [ { "count": 1, "name": "48,633,449" }, { "count": 1, "name": "47,248,719" }, { "count": 1, "name": "40,162,559" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Artist", "stats": { "categories": [ { "count": 1, "name": "Måneskin" }, { "count": 1, "name": "The Kid LAROI" }, { "count": 1, "name": "Olivia Rodrigo" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Artist Followers", "stats": { "categories": [ { "count": 1, "name": "3377762" }, { "count": 1, "name": "2230022" }, { "count": 1, "name": "6266514" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Song ID", "stats": { "categories": [ { "count": 1, "name": "3Wrjm47oTz2sjIgck11l5e" }, { "count": 1, "name": "5HCyWlXZPP0y6Gqq8TgA20" }, { "count": 1, "name": "4ZtFanR9U6ndgddUvNcjcG" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Genre", "stats": { "categories": [ { "count": 1, "name": "['indie rock italiano', 'italian pop']" }, { "count": 1, "name": "['australian hip hop']" }, { "count": 1, "name": "['pop']" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Release Date", "stats": { "categories": [ { "count": 1, "name": "2017-12-08" }, { "count": 1, "name": "2021-07-09" }, { "count": 1, "name": "2021-05-21" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Weeks Charted", "stats": { "categories": [ { "count": 1, "name": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16\n2021-07-02--2021-07-09\n2021-06-25--2021-07-02\n2021-06-18--2021-06-25\n2021-06-11--2021-06-18\n2021-06-04--2021-06-11" }, { "count": 1, "name": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16" }, { "count": 1, "name": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16\n2021-07-02--2021-07-09\n2021-06-25--2021-07-02\n2021-06-18--2021-06-25\n2021-06-11--2021-06-18\n2021-06-04--2021-06-11\n2021-05-28--2021-06-04\n2021-05-21--2021-05-28\n2021-05-14--2021-05-21" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Popularity", "stats": { "categories": [ { "count": 2, "name": "99" }, { "count": 1, "name": "100" } ], "nan_count": 0, "unique_count": 2 } }, { "dtype": "object", "name": "Danceability", "stats": { "categories": [ { "count": 1, "name": "0.714" }, { "count": 1, "name": "0.591" }, { "count": 1, "name": "0.563" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Energy", "stats": { "categories": [ { "count": 1, "name": "0.8" }, { "count": 1, "name": "0.764" }, { "count": 1, "name": "0.664" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Loudness", "stats": { "categories": [ { "count": 1, "name": "-4.808" }, { "count": 1, "name": "-5.484" }, { "count": 1, "name": "-5.044" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Speechiness", "stats": { "categories": [ { "count": 1, "name": "0.0504" }, { "count": 1, "name": "0.0483" }, { "count": 1, "name": "0.154" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Acousticness", "stats": { "categories": [ { "count": 1, "name": "0.127" }, { "count": 1, "name": "0.0383" }, { "count": 1, "name": "0.335" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Liveness", "stats": { "categories": [ { "count": 1, "name": "0.359" }, { "count": 1, "name": "0.103" }, { "count": 1, "name": "0.0849" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Tempo", "stats": { "categories": [ { "count": 1, "name": "134.002" }, { "count": 1, "name": "169.928" }, { "count": 1, "name": "166.928" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Duration (ms)", "stats": { "categories": [ { "count": 1, "name": "211560" }, { "count": 1, "name": "141806" }, { "count": 1, "name": "178147" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Valence", "stats": { "categories": [ { "count": 1, "name": "0.589" }, { "count": 1, "name": "0.478" }, { "count": 1, "name": "0.688" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "object", "name": "Chord", "stats": { "categories": [ { "count": 1, "name": "B" }, { "count": 1, "name": "C#/Db" }, { "count": 1, "name": "A" } ], "nan_count": 0, "unique_count": 3 } }, { "dtype": "int64", "name": "_deepnote_index_column" } ], "row_count": 3, "rows": [ { "Acousticness": "0.127", "Artist": "Måneskin", "Artist Followers": "3377762", "Chord": "B", "Danceability": "0.714", "Duration (ms)": "211560", "Energy": "0.8", "Genre": "['indie rock italiano', 'italian pop']", "Highest Charting Position": 1, "Index": 1, "Liveness": "0.359", "Loudness": "-4.808", "Number of Times Charted": 8, "Popularity": "100", "Release Date": "2017-12-08", "Song ID": "3Wrjm47oTz2sjIgck11l5e", "Song Name": "Beggin'", "Speechiness": "0.0504", "Streams": "48,633,449", "Tempo": "134.002", "Valence": "0.589", "Week of Highest Charting": "2021-07-23--2021-07-30", "Weeks Charted": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16\n2021-07-02--2021-07-09\n2021-06…", "_deepnote_index_column": 0 }, { "Acousticness": "0.0383", "Artist": "The Kid LAROI", "Artist Followers": "2230022", "Chord": "C#/Db", "Danceability": "0.591", "Duration (ms)": "141806", "Energy": "0.764", "Genre": "['australian hip hop']", "Highest Charting Position": 2, "Index": 2, "Liveness": "0.103", "Loudness": "-5.484", "Number of Times Charted": 3, "Popularity": "99", "Release Date": "2021-07-09", "Song ID": "5HCyWlXZPP0y6Gqq8TgA20", "Song Name": "STAY (with Justin Bieber)", "Speechiness": "0.0483", "Streams": "47,248,719", "Tempo": "169.928", "Valence": "0.478", "Week of Highest Charting": "2021-07-23--2021-07-30", "Weeks Charted": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16", "_deepnote_index_column": 1 }, { "Acousticness": "0.335", "Artist": "Olivia Rodrigo", "Artist Followers": "6266514", "Chord": "A", "Danceability": "0.563", "Duration (ms)": "178147", "Energy": "0.664", "Genre": "['pop']", "Highest Charting Position": 1, "Index": 3, "Liveness": "0.0849", "Loudness": "-5.044", "Number of Times Charted": 11, "Popularity": "99", "Release Date": "2021-05-21", "Song ID": "4ZtFanR9U6ndgddUvNcjcG", "Song Name": "good 4 u", "Speechiness": "0.154", "Streams": "40,162,559", "Tempo": "166.928", "Valence": "0.688", "Week of Highest Charting": "2021-06-25--2021-07-02", "Weeks Charted": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16\n2021-07-02--2021-07-09\n2021-06…", "_deepnote_index_column": 2 } ] }, "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
IndexHighest Charting PositionNumber of Times ChartedWeek of Highest ChartingSong NameStreamsArtistArtist FollowersSong IDGenre...DanceabilityEnergyLoudnessSpeechinessAcousticnessLivenessTempoDuration (ms)ValenceChord
01182021-07-23--2021-07-30Beggin'48,633,449Måneskin33777623Wrjm47oTz2sjIgck11l5e['indie rock italiano', 'italian pop']...0.7140.8-4.8080.05040.1270.359134.0022115600.589B
12232021-07-23--2021-07-30STAY (with Justin Bieber)47,248,719The Kid LAROI22300225HCyWlXZPP0y6Gqq8TgA20['australian hip hop']...0.5910.764-5.4840.04830.03830.103169.9281418060.478C#/Db
231112021-06-25--2021-07-02good 4 u40,162,559Olivia Rodrigo62665144ZtFanR9U6ndgddUvNcjcG['pop']...0.5630.664-5.0440.1540.3350.0849166.9281781470.688A
\n", "

3 rows × 23 columns

\n", "
" ], "text/plain": [ " Index Highest Charting Position Number of Times Charted \\\n", "0 1 1 8 \n", "1 2 2 3 \n", "2 3 1 11 \n", "\n", " Week of Highest Charting Song Name Streams \\\n", "0 2021-07-23--2021-07-30 Beggin' 48,633,449 \n", "1 2021-07-23--2021-07-30 STAY (with Justin Bieber) 47,248,719 \n", "2 2021-06-25--2021-07-02 good 4 u 40,162,559 \n", "\n", " Artist Artist Followers Song ID \\\n", "0 Måneskin 3377762 3Wrjm47oTz2sjIgck11l5e \n", "1 The Kid LAROI 2230022 5HCyWlXZPP0y6Gqq8TgA20 \n", "2 Olivia Rodrigo 6266514 4ZtFanR9U6ndgddUvNcjcG \n", "\n", " Genre ... Danceability Energy Loudness \\\n", "0 ['indie rock italiano', 'italian pop'] ... 0.714 0.8 -4.808 \n", "1 ['australian hip hop'] ... 0.591 0.764 -5.484 \n", "2 ['pop'] ... 0.563 0.664 -5.044 \n", "\n", " Speechiness Acousticness Liveness Tempo Duration (ms) Valence Chord \n", "0 0.0504 0.127 0.359 134.002 211560 0.589 B \n", "1 0.0483 0.0383 0.103 169.928 141806 0.478 C#/Db \n", "2 0.154 0.335 0.0849 166.928 178147 0.688 A \n", "\n", "[3 rows x 23 columns]" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df[:3]" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "cell_id": "e19b84f8-2d21-47c1-9e59-0a1a6642ba90", "deepnote_cell_type": "code", "deepnote_output_heights": [ 21 ], "deepnote_to_be_reexecuted": false, "execution_millis": 6, "execution_start": 1643040769493, "source_hash": "2f88c77a", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "1556" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Not too long for Altair (5000 is the cutoff for Altair)\n", "len(df)" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "cell_id": "38c58723-30d4-4288-a211-f63719b57d4c", "deepnote_cell_type": "code", "deepnote_output_heights": [ 21 ], "deepnote_to_be_reexecuted": false, "execution_millis": 6, "execution_start": 1643040846238, "source_hash": "14f60b8f", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "(1556, 23)" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.shape" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "cell_id": "ca9bdc21-7224-477e-ad8d-fbda4683c783", "deepnote_cell_type": "code", "deepnote_output_heights": [ 21.1875 ], "deepnote_to_be_reexecuted": false, "execution_millis": 0, "execution_start": 1643040882740, "source_hash": "1084104f", "tags": [] }, "outputs": [], "source": [ "x = df.shape[0]" ] }, { "cell_type": "code", "execution_count": 22, "metadata": { "cell_id": "2b45cb1e-db09-4d11-b2c4-90c2f4f4dfcd", "deepnote_cell_type": "code", "deepnote_output_heights": [ 21 ], "deepnote_to_be_reexecuted": false, "execution_millis": 6, "execution_start": 1643040884836, "source_hash": "577d5527", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "1556" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "x" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "cell_id": "33b93df4-424a-46cb-8150-9e6e0888830c", "deepnote_cell_type": "code", "deepnote_to_be_reexecuted": false, "execution_millis": 18, "execution_start": 1643040889980, "source_hash": "de1e323c", "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 1556 entries, 0 to 1555\n", "Data columns (total 23 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Index 1556 non-null int64 \n", " 1 Highest Charting Position 1556 non-null int64 \n", " 2 Number of Times Charted 1556 non-null int64 \n", " 3 Week of Highest Charting 1556 non-null object\n", " 4 Song Name 1556 non-null object\n", " 5 Streams 1556 non-null object\n", " 6 Artist 1556 non-null object\n", " 7 Artist Followers 1556 non-null object\n", " 8 Song ID 1556 non-null object\n", " 9 Genre 1556 non-null object\n", " 10 Release Date 1556 non-null object\n", " 11 Weeks Charted 1556 non-null object\n", " 12 Popularity 1556 non-null object\n", " 13 Danceability 1556 non-null object\n", " 14 Energy 1556 non-null object\n", " 15 Loudness 1556 non-null object\n", " 16 Speechiness 1556 non-null object\n", " 17 Acousticness 1556 non-null object\n", " 18 Liveness 1556 non-null object\n", " 19 Tempo 1556 non-null object\n", " 20 Duration (ms) 1556 non-null object\n", " 21 Valence 1556 non-null object\n", " 22 Chord 1556 non-null object\n", "dtypes: int64(3), object(20)\n", "memory usage: 279.7+ KB\n" ] } ], "source": [ "df.info()" ] }, { "cell_type": "code", "execution_count": 25, "metadata": { "cell_id": "acaf380d-205e-438e-bf28-734d7d6dcc60", "deepnote_cell_type": "code", "deepnote_output_heights": [ 21 ], "deepnote_to_be_reexecuted": false, "execution_millis": 5, "execution_start": 1643041055206, "source_hash": "92ad8b2", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "'0.825'" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.loc[10,\"Energy\"]" ] }, { "cell_type": "code", "execution_count": 32, "metadata": { "cell_id": "18567495-55d7-4b15-afda-fb90ef26f13c", "deepnote_cell_type": "code", "deepnote_output_heights": [ 463 ], "deepnote_to_be_reexecuted": false, "execution_millis": 5, "execution_start": 1643041434185, "source_hash": "52430027", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "Index int64\n", "Highest Charting Position int64\n", "Number of Times Charted int64\n", "Week of Highest Charting object\n", "Song Name object\n", "Streams object\n", "Artist object\n", "Artist Followers object\n", "Song ID object\n", "Genre object\n", "Release Date object\n", "Weeks Charted object\n", "Popularity object\n", "Danceability object\n", "Energy object\n", "Loudness object\n", "Speechiness object\n", "Acousticness object\n", "Liveness object\n", "Tempo object\n", "Duration (ms) object\n", "Valence object\n", "Chord object\n", "dtype: object" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.dtypes" ] }, { "cell_type": "code", "execution_count": 26, "metadata": { "cell_id": "c09f7a71-5e8f-4e0f-b4e0-2089a73cb6c7", "deepnote_cell_type": "code", "deepnote_output_heights": [ 424 ], "deepnote_to_be_reexecuted": false, "execution_millis": 31, "execution_start": 1643041111000, "source_hash": "7faab1ed", "tags": [] }, "outputs": [ { "ename": "ValueError", "evalue": "Unable to parse string \" \" at position 35", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", "\u001b[0;32mpandas/_libs/lib.pyx\u001b[0m in \u001b[0;36mpandas._libs.lib.maybe_convert_numeric\u001b[0;34m()\u001b[0m\n", "\u001b[0;31mValueError\u001b[0m: Unable to parse string \" \"", "\nDuring handling of the above exception, another exception occurred:\n", "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto_numeric\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdf\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"Energy\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;32m/shared-libs/python3.7/py/lib/python3.7/site-packages/pandas/core/tools/numeric.py\u001b[0m in \u001b[0;36mto_numeric\u001b[0;34m(arg, errors, downcast)\u001b[0m\n\u001b[1;32m 153\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 154\u001b[0m values = lib.maybe_convert_numeric(\n\u001b[0;32m--> 155\u001b[0;31m \u001b[0mvalues\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcoerce_numeric\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcoerce_numeric\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 156\u001b[0m )\n\u001b[1;32m 157\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mValueError\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32mpandas/_libs/lib.pyx\u001b[0m in \u001b[0;36mpandas._libs.lib.maybe_convert_numeric\u001b[0;34m()\u001b[0m\n", "\u001b[0;31mValueError\u001b[0m: Unable to parse string \" \" at position 35" ] } ], "source": [ "pd.to_numeric(df[\"Energy\"])" ] }, { "cell_type": "code", "execution_count": 28, "metadata": { "cell_id": "64373109-2de8-4f88-a527-6e7b1e911343", "deepnote_cell_type": "code", "deepnote_output_heights": [ 232 ], "deepnote_to_be_reexecuted": false, "execution_millis": 9, "execution_start": 1643041191526, "source_hash": "ea58230", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "0 False\n", "1 False\n", "2 False\n", "3 False\n", "4 False\n", " ... \n", "1551 False\n", "1552 False\n", "1553 False\n", "1554 False\n", "1555 False\n", "Length: 1556, dtype: bool" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.isna().any(axis=1)" ] }, { "cell_type": "code", "execution_count": 29, "metadata": { "cell_id": "ea4384e7-ae64-4678-afa9-3c4330d59020", "deepnote_cell_type": "code", "deepnote_output_heights": [ 21 ], "deepnote_to_be_reexecuted": false, "execution_millis": 5, "execution_start": 1643041214446, "source_hash": "be2ea5da", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.isna().any(axis=1).sum()" ] }, { "cell_type": "code", "execution_count": 30, "metadata": { "cell_id": "3854f5da-aad5-4892-8319-8cb8d52b3701", "deepnote_cell_type": "code", "deepnote_output_heights": [ 21 ], "deepnote_to_be_reexecuted": false, "execution_millis": 2, "execution_start": 1643041297152, "source_hash": "f6cd8832", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"\" == \" \"" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "cell_id": "646e56a1-f5bf-4271-a978-2c74cef011c6", "deepnote_cell_type": "code", "deepnote_to_be_reexecuted": false, "execution_millis": 17, "execution_start": 1643041412276, "source_hash": "4003706d", "tags": [] }, "outputs": [], "source": [ "# Tell pandas what missing values look like\n", "df2 = pd.read_csv(\"../data/spotify_dataset.csv\", na_values=\" \")" ] }, { "cell_type": "code", "execution_count": 33, "metadata": { "cell_id": "b63ee62b-21c4-4930-b454-41d151e54a6f", "deepnote_cell_type": "code", "deepnote_output_heights": [ 463 ], "deepnote_to_be_reexecuted": false, "execution_millis": 8, "execution_start": 1643041448267, "source_hash": "9f23c56a", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "Index int64\n", "Highest Charting Position int64\n", "Number of Times Charted int64\n", "Week of Highest Charting object\n", "Song Name object\n", "Streams object\n", "Artist object\n", "Artist Followers float64\n", "Song ID object\n", "Genre object\n", "Release Date object\n", "Weeks Charted object\n", "Popularity float64\n", "Danceability float64\n", "Energy float64\n", "Loudness float64\n", "Speechiness float64\n", "Acousticness float64\n", "Liveness float64\n", "Tempo float64\n", "Duration (ms) float64\n", "Valence float64\n", "Chord object\n", "dtype: object" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df2.dtypes" ] }, { "cell_type": "code", "execution_count": 34, "metadata": { "cell_id": "81ed34fd-1278-45c7-b6ec-43225762b6d1", "deepnote_cell_type": "code", "deepnote_output_heights": [ 21 ], "deepnote_to_be_reexecuted": false, "execution_millis": 6, "execution_start": 1643041535710, "source_hash": "900425ef", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "11" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Count the bad rows\n", "df2.isna().any(axis=1).sum()" ] }, { "cell_type": "code", "execution_count": 41, "metadata": { "cell_id": "8111b8a2-cc44-4d32-8f68-5e3df0526d8f", "deepnote_cell_type": "code", "deepnote_output_heights": [ 232 ], "deepnote_to_be_reexecuted": false, "execution_millis": 8, "execution_start": 1643041852216, "source_hash": "efef152e", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "0 False\n", "1 False\n", "2 False\n", "3 False\n", "4 False\n", " ... \n", "1551 False\n", "1552 False\n", "1553 False\n", "1554 False\n", "1555 False\n", "Length: 1556, dtype: bool" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df2.isna().any(axis=1)" ] }, { "cell_type": "code", "execution_count": 42, "metadata": { "cell_id": "3b72b2cc-45ce-4265-862c-7b5876642c54", "deepnote_cell_type": "code", "deepnote_to_be_reexecuted": false, "execution_millis": 122, "execution_start": 1643041861978, "source_hash": "9347c639", "tags": [] }, "outputs": [ { "data": { "application/vnd.deepnote.dataframe.v3+json": { "column_count": 23, "columns": [ { "dtype": "int64", "name": "Index", "stats": { "histogram": [ { "bin_end": 186.3, "bin_start": 36, "count": 2 }, { "bin_end": 336.6, "bin_start": 186.3, "count": 0 }, { "bin_end": 486.90000000000003, "bin_start": 336.6, "count": 1 }, { "bin_end": 637.2, "bin_start": 486.90000000000003, "count": 2 }, { "bin_end": 787.5, "bin_start": 637.2, "count": 3 }, { "bin_end": 937.8000000000001, "bin_start": 787.5, "count": 1 }, { "bin_end": 1088.1000000000001, "bin_start": 937.8000000000001, "count": 0 }, { "bin_end": 1238.4, "bin_start": 1088.1000000000001, "count": 1 }, { "bin_end": 1388.7, "bin_start": 1238.4, "count": 0 }, { "bin_end": 1539, "bin_start": 1388.7, "count": 1 } ], "max": "1539", "min": "36", "nan_count": 0, "unique_count": 11 } }, { "dtype": "int64", "name": "Highest Charting Position", "stats": { "histogram": [ { "bin_end": 22.1, "bin_start": 5, "count": 4 }, { "bin_end": 39.2, "bin_start": 22.1, "count": 1 }, { "bin_end": 56.300000000000004, "bin_start": 39.2, "count": 0 }, { "bin_end": 73.4, "bin_start": 56.300000000000004, "count": 1 }, { "bin_end": 90.5, "bin_start": 73.4, "count": 1 }, { "bin_end": 107.60000000000001, "bin_start": 90.5, "count": 0 }, { "bin_end": 124.70000000000002, "bin_start": 107.60000000000001, "count": 1 }, { "bin_end": 141.8, "bin_start": 124.70000000000002, "count": 1 }, { "bin_end": 158.9, "bin_start": 141.8, "count": 0 }, { "bin_end": 176, "bin_start": 158.9, "count": 2 } ], "max": "176", "min": "5", "nan_count": 0, "unique_count": 11 } }, { "dtype": "int64", "name": "Number of Times Charted", "stats": { "histogram": [ { "bin_end": 4.8, "bin_start": 1, "count": 6 }, { "bin_end": 8.6, "bin_start": 4.8, "count": 2 }, { "bin_end": 12.399999999999999, "bin_start": 8.6, "count": 0 }, { "bin_end": 16.2, "bin_start": 12.399999999999999, "count": 1 }, { "bin_end": 20, "bin_start": 16.2, "count": 0 }, { "bin_end": 23.799999999999997, "bin_start": 20, "count": 1 }, { "bin_end": 27.599999999999998, "bin_start": 23.799999999999997, "count": 0 }, { "bin_end": 31.4, "bin_start": 27.599999999999998, "count": 0 }, { "bin_end": 35.199999999999996, "bin_start": 31.4, "count": 0 }, { "bin_end": 39, "bin_start": 35.199999999999996, "count": 1 } ], "max": "39", "min": "1", "nan_count": 0, "unique_count": 7 } }, { "dtype": "object", "name": "Week of Highest Charting", "stats": { "categories": [ { "count": 2, "name": "2020-12-18--2020-12-25" }, { "count": 1, "name": "2021-07-23--2021-07-30" }, { "count": 8, "name": "8 others" } ], "nan_count": 0, "unique_count": 10 } }, { "dtype": "object", "name": "Song Name", "stats": { "categories": [ { "count": 1, "name": "NOT SOBER (feat. Polo G & Stunna Gambino)" }, { "count": 1, "name": "34+35" }, { "count": 9, "name": "9 others" } ], "nan_count": 0, "unique_count": 11 } }, { "dtype": "object", "name": "Streams", "stats": { "categories": [ { "count": 1, "name": "11,869,336" }, { "count": 1, "name": "5,453,159" }, { "count": 9, "name": "9 others" } ], "nan_count": 0, "unique_count": 11 } }, { "dtype": "object", "name": "Artist", "stats": { "categories": [ { "count": 2, "name": "Ariana Grande" }, { "count": 1, "name": "The Kid LAROI" }, { "count": 8, "name": "8 others" } ], "nan_count": 0, "unique_count": 10 } }, { "dtype": "object", "name": "Artist Followers", "stats": { "categories": [ { "count": 11, "name": " " } ], "nan_count": 0, "unique_count": 1 } }, { "dtype": "object", "name": "Song ID", "stats": { "categories": [ { "count": 11, "name": " " } ], "nan_count": 0, "unique_count": 1 } }, { "dtype": "object", "name": "Genre", "stats": { "categories": [ { "count": 11, "name": " " } ], "nan_count": 0, "unique_count": 1 } }, { "dtype": "object", "name": "Release Date", "stats": { "categories": [ { "count": 11, "name": " " } ], "nan_count": 0, "unique_count": 1 } }, { "dtype": "object", "name": "Weeks Charted", "stats": { "categories": [ { "count": 1, "name": "2021-07-23--2021-07-30" }, { "count": 1, "name": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16\n2021-07-02--2021-07-09\n2021-06-25--2021-07-02\n2021-06-18--2021-06-25\n2021-06-11--2021-06-18\n2021-06-04--2021-06-11\n2021-05-28--2021-06-04\n2021-05-21--2021-05-28\n2021-05-14--2021-05-21\n2021-05-07--2021-05-14\n2021-04-30--2021-05-07\n2021-04-23--2021-04-30\n2021-04-16--2021-04-23\n2021-04-09--2021-04-16\n2021-04-02--2021-04-09\n2021-03-26--2021-04-02\n2021-03-19--2021-03-26\n2021-03-12--2021-03-19\n2021-03-05--2021-03-12\n2021-02-26--2021-03-05\n2021-02-19--2021-02-26\n2021-02-12--2021-02-19\n2021-02-05--2021-02-12\n2021-01-29--2021-02-05\n2021-01-22--2021-01-29\n2021-01-15--2021-01-22\n2021-01-08--2021-01-15\n2021-01-01--2021-01-08\n2020-12-25--2021-01-01\n2020-12-18--2020-12-25\n2020-12-11--2020-12-18\n2020-12-04--2020-12-11\n2020-11-27--2020-12-04\n2020-11-20--2020-11-27\n2020-11-13--2020-11-20\n2020-11-06--2020-11-13\n2020-10-30--2020-11-06" }, { "count": 9, "name": "9 others" } ], "nan_count": 0, "unique_count": 11 } }, { "dtype": "object", "name": "Popularity", "stats": { "categories": [ { "count": 11, "name": " " } ], "nan_count": 0, "unique_count": 1 } }, { "dtype": "object", "name": "Danceability", "stats": { "categories": [ { "count": 11, "name": " " } ], "nan_count": 0, "unique_count": 1 } }, { "dtype": "object", "name": "Energy", "stats": { "categories": [ { "count": 11, "name": " " } ], "nan_count": 0, "unique_count": 1 } }, { "dtype": "object", "name": "Loudness", "stats": { "categories": [ { "count": 11, "name": " " } ], "nan_count": 0, "unique_count": 1 } }, { "dtype": "object", "name": "Speechiness", "stats": { "categories": [ { "count": 11, "name": " " } ], "nan_count": 0, "unique_count": 1 } }, { "dtype": "object", "name": "Acousticness", "stats": { "categories": [ { "count": 11, "name": " " } ], "nan_count": 0, "unique_count": 1 } }, { "dtype": "object", "name": "Liveness", "stats": { "categories": [ { "count": 11, "name": " " } ], "nan_count": 0, "unique_count": 1 } }, { "dtype": "object", "name": "Tempo", "stats": { "categories": [ { "count": 11, "name": " " } ], "nan_count": 0, "unique_count": 1 } }, { "dtype": "object", "name": "Duration (ms)", "stats": { "categories": [ { "count": 11, "name": " " } ], "nan_count": 0, "unique_count": 1 } }, { "dtype": "object", "name": "Valence", "stats": { "categories": [ { "count": 11, "name": " " } ], "nan_count": 0, "unique_count": 1 } }, { "dtype": "object", "name": "Chord", "stats": { "categories": [ { "count": 11, "name": " " } ], "nan_count": 0, "unique_count": 1 } }, { "dtype": "int64", "name": "_deepnote_index_column" } ], "row_count": 11, "rows": [ { "Acousticness": " ", "Artist": "The Kid LAROI", "Artist Followers": " ", "Chord": " ", "Danceability": " ", "Duration (ms)": " ", "Energy": " ", "Genre": " ", "Highest Charting Position": 36, "Index": 36, "Liveness": " ", "Loudness": " ", "Number of Times Charted": 1, "Popularity": " ", "Release Date": " ", "Song ID": " ", "Song Name": "NOT SOBER (feat. Polo G & Stunna Gambino)", "Speechiness": " ", "Streams": "11,869,336", "Tempo": " ", "Valence": " ", "Week of Highest Charting": "2021-07-23--2021-07-30", "Weeks Charted": "2021-07-23--2021-07-30", "_deepnote_index_column": 35 }, { "Acousticness": " ", "Artist": "Ariana Grande", "Artist Followers": " ", "Chord": " ", "Danceability": " ", "Duration (ms)": " ", "Energy": " ", "Genre": " ", "Highest Charting Position": 5, "Index": 164, "Liveness": " ", "Loudness": " ", "Number of Times Charted": 39, "Popularity": " ", "Release Date": " ", "Song ID": " ", "Song Name": "34+35", "Speechiness": " ", "Streams": "5,453,159", "Tempo": " ", "Valence": " ", "Week of Highest Charting": "2020-10-30--2020-11-06", "Weeks Charted": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16\n2021-07-02--2021-07-09\n2021-06…", "_deepnote_index_column": 163 }, { "Acousticness": " ", "Artist": "Rod Wave", "Artist Followers": " ", "Chord": " ", "Danceability": " ", "Duration (ms)": " ", "Energy": " ", "Genre": " ", "Highest Charting Position": 118, "Index": 465, "Liveness": " ", "Loudness": " ", "Number of Times Charted": 1, "Popularity": " ", "Release Date": " ", "Song ID": " ", "Song Name": "Richer (feat. Polo G)", "Speechiness": " ", "Streams": "6,292,362", "Tempo": " ", "Valence": " ", "Week of Highest Charting": "2021-03-26--2021-04-02", "Weeks Charted": "2021-03-26--2021-04-02", "_deepnote_index_column": 464 }, { "Acousticness": " ", "Artist": "Ariana Grande", "Artist Followers": " ", "Chord": " ", "Danceability": " ", "Duration (ms)": " ", "Energy": " ", "Genre": " ", "Highest Charting Position": 20, "Index": 531, "Liveness": " ", "Loudness": " ", "Number of Times Charted": 5, "Popularity": " ", "Release Date": " ", "Song ID": " ", "Song Name": "34+35 Remix (feat. Doja Cat, Megan Thee Stallion) - Remix", "Speechiness": " ", "Streams": "6,162,453", "Tempo": " ", "Valence": " ", "Week of Highest Charting": "2021-01-15--2021-01-22", "Weeks Charted": "2021-02-19--2021-02-26\n2021-02-12--2021-02-19\n2021-01-29--2021-02-05\n2021-01-22--2021-01-29\n2021-01…", "_deepnote_index_column": 530 }, { "Acousticness": " ", "Artist": "Chris Rea", "Artist Followers": " ", "Chord": " ", "Danceability": " ", "Duration (ms)": " ", "Energy": " ", "Genre": " ", "Highest Charting Position": 22, "Index": 637, "Liveness": " ", "Loudness": " ", "Number of Times Charted": 6, "Popularity": " ", "Release Date": " ", "Song ID": " ", "Song Name": "Driving Home for Christmas - 2019 Remaster", "Speechiness": " ", "Streams": "8,804,531", "Tempo": " ", "Valence": " ", "Week of Highest Charting": "2020-12-18--2020-12-25", "Weeks Charted": "2020-12-25--2021-01-01\n2020-12-18--2020-12-25\n2020-12-11--2020-12-18\n2020-12-04--2020-12-11\n2020-11…", "_deepnote_index_column": 636 }, { "Acousticness": " ", "Artist": "Queen", "Artist Followers": " ", "Chord": " ", "Danceability": " ", "Duration (ms)": " ", "Energy": " ", "Genre": " ", "Highest Charting Position": 73, "Index": 655, "Liveness": " ", "Loudness": " ", "Number of Times Charted": 1, "Popularity": " ", "Release Date": " ", "Song ID": " ", "Song Name": "Thank God It's Christmas - Non-Album Single", "Speechiness": " ", "Streams": "10,509,961", "Tempo": " ", "Valence": " ", "Week of Highest Charting": "2020-12-18--2020-12-25", "Weeks Charted": "2020-12-18--2020-12-25", "_deepnote_index_column": 654 }, { "Acousticness": " ", "Artist": "Tainy", "Artist Followers": " ", "Chord": " ", "Danceability": " ", "Duration (ms)": " ", "Energy": " ", "Genre": " ", "Highest Charting Position": 19, "Index": 751, "Liveness": " ", "Loudness": " ", "Number of Times Charted": 20, "Popularity": " ", "Release Date": " ", "Song ID": " ", "Song Name": "Agua (with J Balvin) - Music From \"Sponge On The Run\" Movie", "Speechiness": " ", "Streams": "5,358,940", "Tempo": " ", "Valence": " ", "Week of Highest Charting": "2020-07-31--2020-08-07", "Weeks Charted": "2020-11-20--2020-11-27\n2020-11-13--2020-11-20\n2020-11-06--2020-11-13\n2020-10-30--2020-11-06\n2020-10…", "_deepnote_index_column": 750 }, { "Acousticness": " ", "Artist": "Super Yei, Jone Quest", "Artist Followers": " ", "Chord": " ", "Danceability": " ", "Duration (ms)": " ", "Energy": " ", "Genre": " ", "Highest Charting Position": 76, "Index": 785, "Liveness": " ", "Loudness": " ", "Number of Times Charted": 14, "Popularity": " ", "Release Date": " ", "Song ID": " ", "Song Name": "Lean (feat. Towy, Osquel, Beltito & Sammy & Falsetto)", "Speechiness": " ", "Streams": "4,739,241", "Tempo": " ", "Valence": " ", "Week of Highest Charting": "2020-09-04--2020-09-11", "Weeks Charted": "2020-11-13--2020-11-20\n2020-11-06--2020-11-13\n2020-10-30--2020-11-06\n2020-10-23--2020-10-30\n2020-10…", "_deepnote_index_column": 784 }, { "Acousticness": " ", "Artist": "Dalex", "Artist Followers": " ", "Chord": " ", "Danceability": " ", "Duration (ms)": " ", "Energy": " ", "Genre": " ", "Highest Charting Position": 164, "Index": 877, "Liveness": " ", "Loudness": " ", "Number of Times Charted": 4, "Popularity": " ", "Release Date": " ", "Song ID": " ", "Song Name": "+Linda", "Speechiness": " ", "Streams": "4,964,708", "Tempo": " ", "Valence": " ", "Week of Highest Charting": "2020-09-18--2020-09-25", "Weeks Charted": "2020-09-25--2020-10-02\n2020-09-18--2020-09-25\n2020-09-11--2020-09-18\n2020-08-28--2020-09-04", "_deepnote_index_column": 876 }, { "Acousticness": " ", "Artist": "AK AUSSERKONTROLLE, Bonez MC", "Artist Followers": " ", "Chord": " ", "Danceability": " ", "Duration (ms)": " ", "Energy": " ", "Genre": " ", "Highest Charting Position": 131, "Index": 1141, "Liveness": " ", "Loudness": " ", "Number of Times Charted": 1, "Popularity": " ", "Release Date": " ", "Song ID": " ", "Song Name": "In meinem Benz", "Speechiness": " ", "Streams": "5,494,500", "Tempo": " ", "Valence": " ", "Week of Highest Charting": "2020-05-29--2020-06-05", "Weeks Charted": "2020-05-29--2020-06-05", "_deepnote_index_column": 1140 } ] }, "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
IndexHighest Charting PositionNumber of Times ChartedWeek of Highest ChartingSong NameStreamsArtistArtist FollowersSong IDGenre...DanceabilityEnergyLoudnessSpeechinessAcousticnessLivenessTempoDuration (ms)ValenceChord
35363612021-07-23--2021-07-30NOT SOBER (feat. Polo G & Stunna Gambino)11,869,336The Kid LAROI...
1631645392020-10-30--2020-11-0634+355,453,159Ariana Grande...
46446511812021-03-26--2021-04-02Richer (feat. Polo G)6,292,362Rod Wave...
5305312052021-01-15--2021-01-2234+35 Remix (feat. Doja Cat, Megan Thee Stalli...6,162,453Ariana Grande...
6366372262020-12-18--2020-12-25Driving Home for Christmas - 2019 Remaster8,804,531Chris Rea...
6546557312020-12-18--2020-12-25Thank God It's Christmas - Non-Album Single10,509,961Queen...
75075119202020-07-31--2020-08-07Agua (with J Balvin) - Music From \"Sponge On T...5,358,940Tainy...
78478576142020-09-04--2020-09-11Lean (feat. Towy, Osquel, Beltito & Sammy & Fa...4,739,241Super Yei, Jone Quest...
87687716442020-09-18--2020-09-25+Linda4,964,708Dalex...
1140114113112020-05-29--2020-06-05In meinem Benz5,494,500AK AUSSERKONTROLLE, Bonez MC...
1538153917612020-01-03--2020-01-10fuck, i'm lonely (with Anne-Marie) - from “13 ...4,856,458Lauv...
\n", "

11 rows × 23 columns

\n", "
" ], "text/plain": [ " Index Highest Charting Position Number of Times Charted \\\n", "35 36 36 1 \n", "163 164 5 39 \n", "464 465 118 1 \n", "530 531 20 5 \n", "636 637 22 6 \n", "654 655 73 1 \n", "750 751 19 20 \n", "784 785 76 14 \n", "876 877 164 4 \n", "1140 1141 131 1 \n", "1538 1539 176 1 \n", "\n", " Week of Highest Charting \\\n", "35 2021-07-23--2021-07-30 \n", "163 2020-10-30--2020-11-06 \n", "464 2021-03-26--2021-04-02 \n", "530 2021-01-15--2021-01-22 \n", "636 2020-12-18--2020-12-25 \n", "654 2020-12-18--2020-12-25 \n", "750 2020-07-31--2020-08-07 \n", "784 2020-09-04--2020-09-11 \n", "876 2020-09-18--2020-09-25 \n", "1140 2020-05-29--2020-06-05 \n", "1538 2020-01-03--2020-01-10 \n", "\n", " Song Name Streams \\\n", "35 NOT SOBER (feat. Polo G & Stunna Gambino) 11,869,336 \n", "163 34+35 5,453,159 \n", "464 Richer (feat. Polo G) 6,292,362 \n", "530 34+35 Remix (feat. Doja Cat, Megan Thee Stalli... 6,162,453 \n", "636 Driving Home for Christmas - 2019 Remaster 8,804,531 \n", "654 Thank God It's Christmas - Non-Album Single 10,509,961 \n", "750 Agua (with J Balvin) - Music From \"Sponge On T... 5,358,940 \n", "784 Lean (feat. Towy, Osquel, Beltito & Sammy & Fa... 4,739,241 \n", "876 +Linda 4,964,708 \n", "1140 In meinem Benz 5,494,500 \n", "1538 fuck, i'm lonely (with Anne-Marie) - from “13 ... 4,856,458 \n", "\n", " Artist Artist Followers Song ID Genre ... \\\n", "35 The Kid LAROI ... \n", "163 Ariana Grande ... \n", "464 Rod Wave ... \n", "530 Ariana Grande ... \n", "636 Chris Rea ... \n", "654 Queen ... \n", "750 Tainy ... \n", "784 Super Yei, Jone Quest ... \n", "876 Dalex ... \n", "1140 AK AUSSERKONTROLLE, Bonez MC ... \n", "1538 Lauv ... \n", "\n", " Danceability Energy Loudness Speechiness Acousticness Liveness Tempo \\\n", "35 \n", "163 \n", "464 \n", "530 \n", "636 \n", "654 \n", "750 \n", "784 \n", "876 \n", "1140 \n", "1538 \n", "\n", " Duration (ms) Valence Chord \n", "35 \n", "163 \n", "464 \n", "530 \n", "636 \n", "654 \n", "750 \n", "784 \n", "876 \n", "1140 \n", "1538 \n", "\n", "[11 rows x 23 columns]" ] }, "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df[df2.isna().any(axis=1)]" ] }, { "cell_type": "code", "execution_count": 40, "metadata": { "cell_id": "cf05ed1d-72d4-4f72-8a91-9320b276efa9", "deepnote_cell_type": "code", "deepnote_output_heights": [ 21 ], "deepnote_to_be_reexecuted": false, "execution_millis": 8, "execution_start": 1643041825219, "source_hash": "684abd7c", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "1545" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Count the good rows\n", "df2.notna().all(axis=1).sum()" ] }, { "cell_type": "code", "execution_count": 44, "metadata": { "cell_id": "416945dd-a1d0-4557-8e43-89877ac8627d", "deepnote_cell_type": "code", "deepnote_to_be_reexecuted": false, "execution_millis": 197, "execution_start": 1643041943313, "source_hash": "22a3593a", "tags": [] }, "outputs": [ { "data": { "application/vnd.deepnote.dataframe.v3+json": { "column_count": 23, "columns": [ { "dtype": "int64", "name": "Index", "stats": { "histogram": [ { "bin_end": 156.5, "bin_start": 1, "count": 155 }, { "bin_end": 312, "bin_start": 156.5, "count": 154 }, { "bin_end": 467.5, "bin_start": 312, "count": 155 }, { "bin_end": 623, "bin_start": 467.5, "count": 154 }, { "bin_end": 778.5, "bin_start": 623, "count": 153 }, { "bin_end": 934, "bin_start": 778.5, "count": 153 }, { "bin_end": 1089.5, "bin_start": 934, "count": 156 }, { "bin_end": 1245, "bin_start": 1089.5, "count": 154 }, { "bin_end": 1400.5, "bin_start": 1245, "count": 156 }, { "bin_end": 1556, "bin_start": 1400.5, "count": 155 } ], "max": "1556", "min": "1", "nan_count": 0, "unique_count": 1545 } }, { "dtype": "int64", "name": "Highest Charting Position", "stats": { "histogram": [ { "bin_end": 20.9, "bin_start": 1, "count": 238 }, { "bin_end": 40.8, "bin_start": 20.9, "count": 171 }, { "bin_end": 60.699999999999996, "bin_start": 40.8, "count": 181 }, { "bin_end": 80.6, "bin_start": 60.699999999999996, "count": 184 }, { "bin_end": 100.5, "bin_start": 80.6, "count": 141 }, { "bin_end": 120.39999999999999, "bin_start": 100.5, "count": 141 }, { "bin_end": 140.29999999999998, "bin_start": 120.39999999999999, "count": 139 }, { "bin_end": 160.2, "bin_start": 140.29999999999998, "count": 116 }, { "bin_end": 180.1, "bin_start": 160.2, "count": 108 }, { "bin_end": 200, "bin_start": 180.1, "count": 126 } ], "max": "200", "min": "1", "nan_count": 0, "unique_count": 200 } }, { "dtype": "int64", "name": "Number of Times Charted", "stats": { "histogram": [ { "bin_end": 15.1, "bin_start": 1, "count": 1219 }, { "bin_end": 29.2, "bin_start": 15.1, "count": 169 }, { "bin_end": 43.3, "bin_start": 29.2, "count": 74 }, { "bin_end": 57.4, "bin_start": 43.3, "count": 36 }, { "bin_end": 71.5, "bin_start": 57.4, "count": 14 }, { "bin_end": 85.6, "bin_start": 71.5, "count": 32 }, { "bin_end": 99.7, "bin_start": 85.6, "count": 0 }, { "bin_end": 113.8, "bin_start": 99.7, "count": 0 }, { "bin_end": 127.89999999999999, "bin_start": 113.8, "count": 0 }, { "bin_end": 142, "bin_start": 127.89999999999999, "count": 1 } ], "max": "142", "min": "1", "nan_count": 0, "unique_count": 75 } }, { "dtype": "object", "name": "Week of Highest Charting", "stats": { "categories": [ { "count": 89, "name": "2019-12-27--2020-01-03" }, { "count": 66, "name": "2020-12-18--2020-12-25" }, { "count": 1390, "name": "81 others" } ], "nan_count": 0, "unique_count": 83 } }, { "dtype": "object", "name": "Song Name", "stats": { "categories": [ { "count": 1, "name": "Beggin'" }, { "count": 1, "name": "STAY (with Justin Bieber)" }, { "count": 1543, "name": "1543 others" } ], "nan_count": 0, "unique_count": 1545 } }, { "dtype": "object", "name": "Streams", "stats": { "categories": [ { "count": 1, "name": "48,633,449" }, { "count": 1, "name": "47,248,719" }, { "count": 1543, "name": "1543 others" } ], "nan_count": 0, "unique_count": 1545 } }, { "dtype": "object", "name": "Artist", "stats": { "categories": [ { "count": 52, "name": "Taylor Swift" }, { "count": 32, "name": "Justin Bieber" }, { "count": 1461, "name": "710 others" } ], "nan_count": 0, "unique_count": 712 } }, { "dtype": "float64", "name": "Artist Followers", "stats": { "histogram": [ { "bin_end": 8338173, "bin_start": 4883, "count": 849 }, { "bin_end": 16671463, "bin_start": 8338173, "count": 194 }, { "bin_end": 25004753, "bin_start": 16671463, "count": 130 }, { "bin_end": 33338043, "bin_start": 25004753, "count": 88 }, { "bin_end": 41671333, "bin_start": 33338043, "count": 122 }, { "bin_end": 50004623, "bin_start": 41671333, "count": 115 }, { "bin_end": 58337913, "bin_start": 50004623, "count": 21 }, { "bin_end": 66671203, "bin_start": 58337913, "count": 0 }, { "bin_end": 75004493, "bin_start": 66671203, "count": 18 }, { "bin_end": 83337783, "bin_start": 75004493, "count": 8 } ], "max": "83337783.0", "min": "4883.0", "nan_count": 0, "unique_count": 599 } }, { "dtype": "object", "name": "Song ID", "stats": { "categories": [ { "count": 3, "name": "5uEYRdEIh9Bo4fpjDd4Na9" }, { "count": 2, "name": "463CkQjx2Zk1yXoBuierM9" }, { "count": 1540, "name": "1514 others" } ], "nan_count": 0, "unique_count": 1516 } }, { "dtype": "object", "name": "Genre", "stats": { "categories": [ { "count": 75, "name": "[]" }, { "count": 71, "name": "['dance pop', 'pop', 'post-teen pop']" }, { "count": 1399, "name": "392 others" } ], "nan_count": 0, "unique_count": 394 } }, { "dtype": "object", "name": "Release Date", "stats": { "categories": [ { "count": 34, "name": "2020-01-17" }, { "count": 28, "name": "2020-02-14" }, { "count": 1483, "name": "475 others" } ], "nan_count": 0, "unique_count": 477 } }, { "dtype": "object", "name": "Weeks Charted", "stats": { "categories": [ { "count": 31, "name": "2020-12-18--2020-12-25" }, { "count": 24, "name": "2020-01-17--2020-01-24" }, { "count": 1490, "name": "769 others" } ], "nan_count": 0, "unique_count": 771 } }, { "dtype": "float64", "name": "Popularity", "stats": { "histogram": [ { "bin_end": 10, "bin_start": 0, "count": 44 }, { "bin_end": 20, "bin_start": 10, "count": 1 }, { "bin_end": 30, "bin_start": 20, "count": 2 }, { "bin_end": 40, "bin_start": 30, "count": 3 }, { "bin_end": 50, "bin_start": 40, "count": 40 }, { "bin_end": 60, "bin_start": 50, "count": 126 }, { "bin_end": 70, "bin_start": 60, "count": 374 }, { "bin_end": 80, "bin_start": 70, "count": 563 }, { "bin_end": 90, "bin_start": 80, "count": 357 }, { "bin_end": 100, "bin_start": 90, "count": 35 } ], "max": "100.0", "min": "0.0", "nan_count": 0, "unique_count": 69 } }, { "dtype": "float64", "name": "Danceability", "stats": { "histogram": [ { "bin_end": 0.23299999999999998, "bin_start": 0.15, "count": 4 }, { "bin_end": 0.31599999999999995, "bin_start": 0.23299999999999998, "count": 10 }, { "bin_end": 0.39899999999999997, "bin_start": 0.31599999999999995, "count": 50 }, { "bin_end": 0.482, "bin_start": 0.39899999999999997, "count": 75 }, { "bin_end": 0.565, "bin_start": 0.482, "count": 142 }, { "bin_end": 0.6479999999999999, "bin_start": 0.565, "count": 246 }, { "bin_end": 0.731, "bin_start": 0.6479999999999999, "count": 338 }, { "bin_end": 0.814, "bin_start": 0.731, "count": 365 }, { "bin_end": 0.8969999999999999, "bin_start": 0.814, "count": 248 }, { "bin_end": 0.98, "bin_start": 0.8969999999999999, "count": 67 } ], "max": "0.98", "min": "0.15", "nan_count": 0, "unique_count": 529 } }, { "dtype": "float64", "name": "Energy", "stats": { "histogram": [ { "bin_end": 0.14559999999999998, "bin_start": 0.054, "count": 8 }, { "bin_end": 0.23719999999999997, "bin_start": 0.14559999999999998, "count": 16 }, { "bin_end": 0.3287999999999999, "bin_start": 0.23719999999999997, "count": 47 }, { "bin_end": 0.42039999999999994, "bin_start": 0.3287999999999999, "count": 78 }, { "bin_end": 0.512, "bin_start": 0.42039999999999994, "count": 173 }, { "bin_end": 0.6035999999999999, "bin_start": 0.512, "count": 283 }, { "bin_end": 0.6951999999999999, "bin_start": 0.6035999999999999, "count": 357 }, { "bin_end": 0.7867999999999999, "bin_start": 0.6951999999999999, "count": 292 }, { "bin_end": 0.8784, "bin_start": 0.7867999999999999, "count": 218 }, { "bin_end": 0.97, "bin_start": 0.8784, "count": 73 } ], "max": "0.97", "min": "0.054", "nan_count": 0, "unique_count": 574 } }, { "dtype": "float64", "name": "Loudness", "stats": { "histogram": [ { "bin_end": -22.4985, "bin_start": -25.166, "count": 2 }, { "bin_end": -19.831, "bin_start": -22.4985, "count": 1 }, { "bin_end": -17.1635, "bin_start": -19.831, "count": 3 }, { "bin_end": -14.496, "bin_start": -17.1635, "count": 15 }, { "bin_end": -11.8285, "bin_start": -14.496, "count": 27 }, { "bin_end": -9.161000000000001, "bin_start": -11.8285, "count": 104 }, { "bin_end": -6.493500000000001, "bin_start": -9.161000000000001, "count": 490 }, { "bin_end": -3.8260000000000005, "bin_start": -6.493500000000001, "count": 727 }, { "bin_end": -1.1585, "bin_start": -3.8260000000000005, "count": 174 }, { "bin_end": 1.509, "bin_start": -1.1585, "count": 2 } ], "max": "1.509", "min": "-25.166", "nan_count": 0, "unique_count": 1393 } }, { "dtype": "float64", "name": "Speechiness", "stats": { "histogram": [ { "bin_end": 0.10928, "bin_start": 0.0232, "count": 973 }, { "bin_end": 0.19536, "bin_start": 0.10928, "count": 245 }, { "bin_end": 0.28144, "bin_start": 0.19536, "count": 140 }, { "bin_end": 0.36752, "bin_start": 0.28144, "count": 122 }, { "bin_end": 0.4536, "bin_start": 0.36752, "count": 49 }, { "bin_end": 0.53968, "bin_start": 0.4536, "count": 11 }, { "bin_end": 0.62576, "bin_start": 0.53968, "count": 2 }, { "bin_end": 0.71184, "bin_start": 0.62576, "count": 1 }, { "bin_end": 0.7979200000000001, "bin_start": 0.71184, "count": 1 }, { "bin_end": 0.884, "bin_start": 0.7979200000000001, "count": 1 } ], "max": "0.884", "min": "0.0232", "nan_count": 0, "unique_count": 771 } }, { "dtype": "float64", "name": "Acousticness", "stats": { "histogram": [ { "bin_end": 0.09942295, "bin_start": 2.55e-05, "count": 585 }, { "bin_end": 0.1988204, "bin_start": 0.09942295, "count": 290 }, { "bin_end": 0.29821785, "bin_start": 0.1988204, "count": 176 }, { "bin_end": 0.3976153, "bin_start": 0.29821785, "count": 123 }, { "bin_end": 0.49701275, "bin_start": 0.3976153, "count": 108 }, { "bin_end": 0.5964102, "bin_start": 0.49701275, "count": 75 }, { "bin_end": 0.69580765, "bin_start": 0.5964102, "count": 55 }, { "bin_end": 0.7952051, "bin_start": 0.69580765, "count": 48 }, { "bin_end": 0.89460255, "bin_start": 0.7952051, "count": 52 }, { "bin_end": 0.994, "bin_start": 0.89460255, "count": 33 } ], "max": "0.994", "min": "2.55e-05", "nan_count": 0, "unique_count": 964 } }, { "dtype": "float64", "name": "Liveness", "stats": { "histogram": [ { "bin_end": 0.11392999999999999, "bin_start": 0.0197, "count": 664 }, { "bin_end": 0.20815999999999998, "bin_start": 0.11392999999999999, "count": 476 }, { "bin_end": 0.30239, "bin_start": 0.20815999999999998, "count": 163 }, { "bin_end": 0.39662, "bin_start": 0.30239, "count": 138 }, { "bin_end": 0.49084999999999995, "bin_start": 0.39662, "count": 34 }, { "bin_end": 0.58508, "bin_start": 0.49084999999999995, "count": 19 }, { "bin_end": 0.67931, "bin_start": 0.58508, "count": 18 }, { "bin_end": 0.77354, "bin_start": 0.67931, "count": 16 }, { "bin_end": 0.86777, "bin_start": 0.77354, "count": 9 }, { "bin_end": 0.962, "bin_start": 0.86777, "count": 8 } ], "max": "0.962", "min": "0.0197", "nan_count": 0, "unique_count": 605 } }, { "dtype": "float64", "name": "Tempo", "stats": { "histogram": [ { "bin_end": 62.5734, "bin_start": 46.718, "count": 1 }, { "bin_end": 78.4288, "bin_start": 62.5734, "count": 70 }, { "bin_end": 94.2842, "bin_start": 78.4288, "count": 255 }, { "bin_end": 110.1396, "bin_start": 94.2842, "count": 260 }, { "bin_end": 125.99499999999999, "bin_start": 110.1396, "count": 285 }, { "bin_end": 141.85039999999998, "bin_start": 125.99499999999999, "count": 252 }, { "bin_end": 157.70579999999998, "bin_start": 141.85039999999998, "count": 195 }, { "bin_end": 173.56119999999999, "bin_start": 157.70579999999998, "count": 132 }, { "bin_end": 189.41659999999996, "bin_start": 173.56119999999999, "count": 82 }, { "bin_end": 205.272, "bin_start": 189.41659999999996, "count": 13 } ], "max": "205.272", "min": "46.718", "nan_count": 0, "unique_count": 1460 } }, { "dtype": "float64", "name": "Duration (ms)", "stats": { "histogram": [ { "bin_end": 85933.6, "bin_start": 30133, "count": 12 }, { "bin_end": 141734.2, "bin_start": 85933.6, "count": 91 }, { "bin_end": 197534.8, "bin_start": 141734.2, "count": 730 }, { "bin_end": 253335.4, "bin_start": 197534.8, "count": 569 }, { "bin_end": 309136, "bin_start": 253335.4, "count": 107 }, { "bin_end": 364936.6, "bin_start": 309136, "count": 27 }, { "bin_end": 420737.2, "bin_start": 364936.6, "count": 5 }, { "bin_end": 476537.8, "bin_start": 420737.2, "count": 1 }, { "bin_end": 532338.3999999999, "bin_start": 476537.8, "count": 2 }, { "bin_end": 588139, "bin_start": 532338.3999999999, "count": 1 } ], "max": "588139.0", "min": "30133.0", "nan_count": 0, "unique_count": 1485 } }, { "dtype": "float64", "name": "Valence", "stats": { "histogram": [ { "bin_end": 0.12669999999999998, "bin_start": 0.032, "count": 62 }, { "bin_end": 0.22139999999999999, "bin_start": 0.12669999999999998, "count": 112 }, { "bin_end": 0.31609999999999994, "bin_start": 0.22139999999999999, "count": 157 }, { "bin_end": 0.41079999999999994, "bin_start": 0.31609999999999994, "count": 193 }, { "bin_end": 0.5055, "bin_start": 0.41079999999999994, "count": 230 }, { "bin_end": 0.6002, "bin_start": 0.5055, "count": 213 }, { "bin_end": 0.6949, "bin_start": 0.6002, "count": 196 }, { "bin_end": 0.7896, "bin_start": 0.6949, "count": 171 }, { "bin_end": 0.8843, "bin_start": 0.7896, "count": 133 }, { "bin_end": 0.979, "bin_start": 0.8843, "count": 78 } ], "max": "0.979", "min": "0.032", "nan_count": 0, "unique_count": 731 } }, { "dtype": "object", "name": "Chord", "stats": { "categories": [ { "count": 214, "name": "C#/Db" }, { "count": 155, "name": "C" }, { "count": 1176, "name": "10 others" } ], "nan_count": 0, "unique_count": 12 } }, { "dtype": "int64", "name": "_deepnote_index_column" } ], "row_count": 1545, "rows": [ { "Acousticness": 0.127, "Artist": "Måneskin", "Artist Followers": 3377762, "Chord": "B", "Danceability": 0.714, "Duration (ms)": 211560, "Energy": 0.8, "Genre": "['indie rock italiano', 'italian pop']", "Highest Charting Position": 1, "Index": 1, "Liveness": 0.359, "Loudness": -4.808, "Number of Times Charted": 8, "Popularity": 100, "Release Date": "2017-12-08", "Song ID": "3Wrjm47oTz2sjIgck11l5e", "Song Name": "Beggin'", "Speechiness": 0.0504, "Streams": "48,633,449", "Tempo": 134.002, "Valence": 0.589, "Week of Highest Charting": "2021-07-23--2021-07-30", "Weeks Charted": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16\n2021-07-02--2021-07-09\n2021-06…", "_deepnote_index_column": 0 }, { "Acousticness": 0.0383, "Artist": "The Kid LAROI", "Artist Followers": 2230022, "Chord": "C#/Db", "Danceability": 0.591, "Duration (ms)": 141806, "Energy": 0.764, "Genre": "['australian hip hop']", "Highest Charting Position": 2, "Index": 2, "Liveness": 0.103, "Loudness": -5.484, "Number of Times Charted": 3, "Popularity": 99, "Release Date": "2021-07-09", "Song ID": "5HCyWlXZPP0y6Gqq8TgA20", "Song Name": "STAY (with Justin Bieber)", "Speechiness": 0.0483, "Streams": "47,248,719", "Tempo": 169.928, "Valence": 0.478, "Week of Highest Charting": "2021-07-23--2021-07-30", "Weeks Charted": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16", "_deepnote_index_column": 1 }, { "Acousticness": 0.335, "Artist": "Olivia Rodrigo", "Artist Followers": 6266514, "Chord": "A", "Danceability": 0.563, "Duration (ms)": 178147, "Energy": 0.664, "Genre": "['pop']", "Highest Charting Position": 1, "Index": 3, "Liveness": 0.0849, "Loudness": -5.044, "Number of Times Charted": 11, "Popularity": 99, "Release Date": "2021-05-21", "Song ID": "4ZtFanR9U6ndgddUvNcjcG", "Song Name": "good 4 u", "Speechiness": 0.154, "Streams": "40,162,559", "Tempo": 166.928, "Valence": 0.688, "Week of Highest Charting": "2021-06-25--2021-07-02", "Weeks Charted": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16\n2021-07-02--2021-07-09\n2021-06…", "_deepnote_index_column": 2 }, { "Acousticness": 0.0469, "Artist": "Ed Sheeran", "Artist Followers": 83293380, "Chord": "B", "Danceability": 0.808, "Duration (ms)": 231041, "Energy": 0.897, "Genre": "['pop', 'uk pop']", "Highest Charting Position": 3, "Index": 4, "Liveness": 0.364, "Loudness": -3.712, "Number of Times Charted": 5, "Popularity": 98, "Release Date": "2021-06-25", "Song ID": "6PQ88X9TkUIAUIZJHW2upE", "Song Name": "Bad Habits", "Speechiness": 0.0348, "Streams": "37,799,456", "Tempo": 126.026, "Valence": 0.591, "Week of Highest Charting": "2021-07-02--2021-07-09", "Weeks Charted": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16\n2021-07-02--2021-07-09\n2021-06…", "_deepnote_index_column": 3 }, { "Acousticness": 0.0203, "Artist": "Lil Nas X", "Artist Followers": 5473565, "Chord": "D#/Eb", "Danceability": 0.736, "Duration (ms)": 212000, "Energy": 0.704, "Genre": "['lgbtq+ hip hop', 'pop rap']", "Highest Charting Position": 5, "Index": 5, "Liveness": 0.0501, "Loudness": -7.409, "Number of Times Charted": 1, "Popularity": 96, "Release Date": "2021-07-23", "Song ID": "27NovPIUIRrOZoCHxABJwK", "Song Name": "INDUSTRY BABY (feat. Jack Harlow)", "Speechiness": 0.0615, "Streams": "33,948,454", "Tempo": 149.995, "Valence": 0.894, "Week of Highest Charting": "2021-07-23--2021-07-30", "Weeks Charted": "2021-07-23--2021-07-30", "_deepnote_index_column": 4 }, { "Acousticness": 0.297, "Artist": "Lil Nas X", "Artist Followers": 5473565, "Chord": "G#/Ab", "Danceability": 0.61, "Duration (ms)": 137876, "Energy": 0.508, "Genre": "['lgbtq+ hip hop', 'pop rap']", "Highest Charting Position": 1, "Index": 6, "Liveness": 0.384, "Loudness": -6.682, "Number of Times Charted": 18, "Popularity": 97, "Release Date": "2021-03-31", "Song ID": "67BtfxlNbhBmCDR2L2l8qd", "Song Name": "MONTERO (Call Me By Your Name)", "Speechiness": 0.152, "Streams": "30,071,134", "Tempo": 178.818, "Valence": 0.758, "Week of Highest Charting": "2021-05-07--2021-05-14", "Weeks Charted": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16\n2021-07-02--2021-07-09\n2021-06…", "_deepnote_index_column": 5 }, { "Acousticness": 0.235, "Artist": "Doja Cat", "Artist Followers": 8640063, "Chord": "G#/Ab", "Danceability": 0.762, "Duration (ms)": 208867, "Energy": 0.701, "Genre": "['dance pop', 'pop']", "Highest Charting Position": 3, "Index": 7, "Liveness": 0.123, "Loudness": -3.541, "Number of Times Charted": 16, "Popularity": 94, "Release Date": "2021-04-09", "Song ID": "748mdHapucXQri7IAO8yFK", "Song Name": "Kiss Me More (feat. SZA)", "Speechiness": 0.0286, "Streams": "29,356,736", "Tempo": 110.968, "Valence": 0.742, "Week of Highest Charting": "2021-05-14--2021-05-21", "Weeks Charted": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16\n2021-07-02--2021-07-09\n2021-06…", "_deepnote_index_column": 6 }, { "Acousticness": 0.31, "Artist": "Rauw Alejandro", "Artist Followers": 6080597, "Chord": "D#/Eb", "Danceability": 0.78, "Duration (ms)": 199604, "Energy": 0.718, "Genre": "['puerto rican pop', 'trap latino']", "Highest Charting Position": 2, "Index": 8, "Liveness": 0.0932, "Loudness": -3.605, "Number of Times Charted": 10, "Popularity": 95, "Release Date": "2021-05-20", "Song ID": "4fSIb4hdOQ151TILNsSEaF", "Song Name": "Todo De Ti", "Speechiness": 0.0506, "Streams": "26,951,613", "Tempo": 127.949, "Valence": 0.342, "Week of Highest Charting": "2021-06-18--2021-06-25", "Weeks Charted": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16\n2021-07-02--2021-07-09\n2021-06…", "_deepnote_index_column": 7 }, { "Acousticness": 0.276, "Artist": "Bad Bunny", "Artist Followers": 36142273, "Chord": "C#/Db", "Danceability": 0.644, "Duration (ms)": 206710, "Energy": 0.648, "Genre": "['latin', 'reggaeton', 'trap latino']", "Highest Charting Position": 3, "Index": 9, "Liveness": 0.135, "Loudness": -4.601, "Number of Times Charted": 8, "Popularity": 96, "Release Date": "2021-06-04", "Song ID": "2JPLbjOn0wPCngEot2STUS", "Song Name": "Yonaguni", "Speechiness": 0.118, "Streams": "25,030,128", "Tempo": 179.951, "Valence": 0.44, "Week of Highest Charting": "2021-06-18--2021-06-25", "Weeks Charted": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16\n2021-07-02--2021-07-09\n2021-06…", "_deepnote_index_column": 8 }, { "Acousticness": 0.00165, "Artist": "Måneskin", "Artist Followers": 3377762, "Chord": "C#/Db", "Danceability": 0.75, "Duration (ms)": 173347, "Energy": 0.608, "Genre": "['indie rock italiano', 'italian pop']", "Highest Charting Position": 8, "Index": 10, "Liveness": 0.178, "Loudness": -4.008, "Number of Times Charted": 10, "Popularity": 95, "Release Date": "2021-03-19", "Song ID": "4pt5fDVTg5GhEvEtlz9dKk", "Song Name": "I WANNA BE YOUR SLAVE", "Speechiness": 0.0387, "Streams": "24,551,591", "Tempo": 132.507, "Valence": 0.958, "Week of Highest Charting": "2021-07-02--2021-07-09", "Weeks Charted": "2021-07-23--2021-07-30\n2021-07-16--2021-07-23\n2021-07-09--2021-07-16\n2021-07-02--2021-07-09\n2021-06…", "_deepnote_index_column": 9 } ] }, "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
IndexHighest Charting PositionNumber of Times ChartedWeek of Highest ChartingSong NameStreamsArtistArtist FollowersSong IDGenre...DanceabilityEnergyLoudnessSpeechinessAcousticnessLivenessTempoDuration (ms)ValenceChord
01182021-07-23--2021-07-30Beggin'48,633,449Måneskin3377762.03Wrjm47oTz2sjIgck11l5e['indie rock italiano', 'italian pop']...0.7140.800-4.8080.05040.127000.3590134.002211560.00.589B
12232021-07-23--2021-07-30STAY (with Justin Bieber)47,248,719The Kid LAROI2230022.05HCyWlXZPP0y6Gqq8TgA20['australian hip hop']...0.5910.764-5.4840.04830.038300.1030169.928141806.00.478C#/Db
231112021-06-25--2021-07-02good 4 u40,162,559Olivia Rodrigo6266514.04ZtFanR9U6ndgddUvNcjcG['pop']...0.5630.664-5.0440.15400.335000.0849166.928178147.00.688A
34352021-07-02--2021-07-09Bad Habits37,799,456Ed Sheeran83293380.06PQ88X9TkUIAUIZJHW2upE['pop', 'uk pop']...0.8080.897-3.7120.03480.046900.3640126.026231041.00.591B
45512021-07-23--2021-07-30INDUSTRY BABY (feat. Jack Harlow)33,948,454Lil Nas X5473565.027NovPIUIRrOZoCHxABJwK['lgbtq+ hip hop', 'pop rap']...0.7360.704-7.4090.06150.020300.0501149.995212000.00.894D#/Eb
..................................................................
1551155219512019-12-27--2020-01-03New Rules4,630,675Dua Lipa27167675.02ekn2ttSfGqwhhate0LSR0['dance pop', 'pop', 'uk pop']...0.7620.700-6.0210.06940.002610.1530116.073209320.00.608A
1552155319612019-12-27--2020-01-03Cheirosa - Ao Vivo4,623,030Jorge & Mateus15019109.02PWjKmjyTZeDpmOUa3a5da['sertanejo', 'sertanejo universitario']...0.5280.870-3.1230.08510.240000.3330152.370181930.00.714B
1553155419712019-12-27--2020-01-03Havana (feat. Young Thug)4,620,876Camila Cabello22698747.01rfofaqEpACxVEHIZBJe6W['dance pop', 'electropop', 'pop', 'post-teen ......0.7650.523-4.3330.03000.184000.1320104.988217307.00.394D
1554155519812019-12-27--2020-01-03Surtada - Remix Brega Funk4,607,385Dadá Boladão, Tati Zaqui, OIK208630.05F8ffc8KWKNawllr5WsW0r['brega funk', 'funk carioca']...0.8320.550-7.0260.05870.249000.1820154.064152784.00.881F
1555155619912019-12-27--2020-01-03Lover (Remix) [feat. Shawn Mendes]4,595,450Taylor Swift42227614.03i9UVldZOE0aD0JnyfAZZ0['pop', 'post-teen pop']...0.4480.603-7.1760.06400.433000.0862205.272221307.00.422G
\n", "

1545 rows × 23 columns

\n", "
" ], "text/plain": [ " Index Highest Charting Position Number of Times Charted \\\n", "0 1 1 8 \n", "1 2 2 3 \n", "2 3 1 11 \n", "3 4 3 5 \n", "4 5 5 1 \n", "... ... ... ... \n", "1551 1552 195 1 \n", "1552 1553 196 1 \n", "1553 1554 197 1 \n", "1554 1555 198 1 \n", "1555 1556 199 1 \n", "\n", " Week of Highest Charting Song Name Streams \\\n", "0 2021-07-23--2021-07-30 Beggin' 48,633,449 \n", "1 2021-07-23--2021-07-30 STAY (with Justin Bieber) 47,248,719 \n", "2 2021-06-25--2021-07-02 good 4 u 40,162,559 \n", "3 2021-07-02--2021-07-09 Bad Habits 37,799,456 \n", "4 2021-07-23--2021-07-30 INDUSTRY BABY (feat. Jack Harlow) 33,948,454 \n", "... ... ... ... \n", "1551 2019-12-27--2020-01-03 New Rules 4,630,675 \n", "1552 2019-12-27--2020-01-03 Cheirosa - Ao Vivo 4,623,030 \n", "1553 2019-12-27--2020-01-03 Havana (feat. Young Thug) 4,620,876 \n", "1554 2019-12-27--2020-01-03 Surtada - Remix Brega Funk 4,607,385 \n", "1555 2019-12-27--2020-01-03 Lover (Remix) [feat. Shawn Mendes] 4,595,450 \n", "\n", " Artist Artist Followers Song ID \\\n", "0 Måneskin 3377762.0 3Wrjm47oTz2sjIgck11l5e \n", "1 The Kid LAROI 2230022.0 5HCyWlXZPP0y6Gqq8TgA20 \n", "2 Olivia Rodrigo 6266514.0 4ZtFanR9U6ndgddUvNcjcG \n", "3 Ed Sheeran 83293380.0 6PQ88X9TkUIAUIZJHW2upE \n", "4 Lil Nas X 5473565.0 27NovPIUIRrOZoCHxABJwK \n", "... ... ... ... \n", "1551 Dua Lipa 27167675.0 2ekn2ttSfGqwhhate0LSR0 \n", "1552 Jorge & Mateus 15019109.0 2PWjKmjyTZeDpmOUa3a5da \n", "1553 Camila Cabello 22698747.0 1rfofaqEpACxVEHIZBJe6W \n", "1554 Dadá Boladão, Tati Zaqui, OIK 208630.0 5F8ffc8KWKNawllr5WsW0r \n", "1555 Taylor Swift 42227614.0 3i9UVldZOE0aD0JnyfAZZ0 \n", "\n", " Genre ... Danceability \\\n", "0 ['indie rock italiano', 'italian pop'] ... 0.714 \n", "1 ['australian hip hop'] ... 0.591 \n", "2 ['pop'] ... 0.563 \n", "3 ['pop', 'uk pop'] ... 0.808 \n", "4 ['lgbtq+ hip hop', 'pop rap'] ... 0.736 \n", "... ... ... ... \n", "1551 ['dance pop', 'pop', 'uk pop'] ... 0.762 \n", "1552 ['sertanejo', 'sertanejo universitario'] ... 0.528 \n", "1553 ['dance pop', 'electropop', 'pop', 'post-teen ... ... 0.765 \n", "1554 ['brega funk', 'funk carioca'] ... 0.832 \n", "1555 ['pop', 'post-teen pop'] ... 0.448 \n", "\n", " Energy Loudness Speechiness Acousticness Liveness Tempo \\\n", "0 0.800 -4.808 0.0504 0.12700 0.3590 134.002 \n", "1 0.764 -5.484 0.0483 0.03830 0.1030 169.928 \n", "2 0.664 -5.044 0.1540 0.33500 0.0849 166.928 \n", "3 0.897 -3.712 0.0348 0.04690 0.3640 126.026 \n", "4 0.704 -7.409 0.0615 0.02030 0.0501 149.995 \n", "... ... ... ... ... ... ... \n", "1551 0.700 -6.021 0.0694 0.00261 0.1530 116.073 \n", "1552 0.870 -3.123 0.0851 0.24000 0.3330 152.370 \n", "1553 0.523 -4.333 0.0300 0.18400 0.1320 104.988 \n", "1554 0.550 -7.026 0.0587 0.24900 0.1820 154.064 \n", "1555 0.603 -7.176 0.0640 0.43300 0.0862 205.272 \n", "\n", " Duration (ms) Valence Chord \n", "0 211560.0 0.589 B \n", "1 141806.0 0.478 C#/Db \n", "2 178147.0 0.688 A \n", "3 231041.0 0.591 B \n", "4 212000.0 0.894 D#/Eb \n", "... ... ... ... \n", "1551 209320.0 0.608 A \n", "1552 181930.0 0.714 B \n", "1553 217307.0 0.394 D \n", "1554 152784.0 0.881 F \n", "1555 221307.0 0.422 G \n", "\n", "[1545 rows x 23 columns]" ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Keep just the good rows\n", "df3 = df2[df2.notna().all(axis=1)].copy()\n", "df3" ] }, { "cell_type": "code", "execution_count": 45, "metadata": { "cell_id": "14319574-becf-4f61-8593-9d562f890678", "deepnote_cell_type": "code", "deepnote_output_heights": [ 21 ], "deepnote_to_be_reexecuted": false, "execution_millis": 4, "execution_start": 1643041953662, "source_hash": "c4af1a73", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "(1545, 23)" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df3.shape" ] }, { "cell_type": "code", "execution_count": 47, "metadata": { "cell_id": "e0babce9-f23e-4572-ae66-d1224e78e3fa", "deepnote_cell_type": "code", "deepnote_output_heights": [ 356 ], "deepnote_to_be_reexecuted": false, "execution_millis": 269, "execution_start": 1643041991464, "source_hash": "778916d0", "tags": [] }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "alt.Chart(df2).mark_circle().encode(\n", " x = \"Energy\",\n", " y = \"Loudness\"\n", ")" ] }, { "cell_type": "code", "execution_count": 48, "metadata": { "cell_id": "e7dcb013-35ff-43ed-93e8-ac3161449eb8", "deepnote_cell_type": "code", "deepnote_output_heights": [ 356 ], "deepnote_to_be_reexecuted": false, "execution_millis": 322, "execution_start": 1643042048095, "source_hash": "bf531c19", "tags": [] }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "alt.Chart(df2).mark_circle().encode(\n", " x = alt.X(\"Energy\", scale = alt.Scale(domain=(0.1,0.8))),\n", " y = \"Loudness\"\n", ")" ] }, { "cell_type": "code", "execution_count": 54, "metadata": { "cell_id": "58417530-11a9-4d55-b80f-7685dd9cbabb", "deepnote_cell_type": "code", "deepnote_output_heights": [ 356 ], "deepnote_to_be_reexecuted": false, "execution_millis": 223, "execution_start": 1643042170337, "source_hash": "53945be8", "tags": [] }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "alt.Chart(df2).mark_circle(clip=True, color=\"Red\",size=100).encode(\n", " x = alt.X(\"Energy\", scale = alt.Scale(domain=(0.1,0.8))),\n", " y = \"Loudness\"\n", ")" ] }, { "cell_type": "code", "execution_count": 58, "metadata": { "cell_id": "f74d0ca0-2db5-4362-8d7e-98c4a65e1c54", "deepnote_cell_type": "code", "deepnote_output_heights": [ 463 ], "deepnote_to_be_reexecuted": false, "execution_millis": 10, "execution_start": 1643042225406, "source_hash": "9f23c56a", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "Index int64\n", "Highest Charting Position int64\n", "Number of Times Charted int64\n", "Week of Highest Charting object\n", "Song Name object\n", "Streams object\n", "Artist object\n", "Artist Followers float64\n", "Song ID object\n", "Genre object\n", "Release Date object\n", "Weeks Charted object\n", "Popularity float64\n", "Danceability float64\n", "Energy float64\n", "Loudness float64\n", "Speechiness float64\n", "Acousticness float64\n", "Liveness float64\n", "Tempo float64\n", "Duration (ms) float64\n", "Valence float64\n", "Chord object\n", "dtype: object" ] }, "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df2.dtypes" ] }, { "cell_type": "code", "execution_count": 59, "metadata": { "cell_id": "d898f529-20a1-455f-844f-56033631f6f7", "deepnote_cell_type": "code", "deepnote_output_heights": [ 356 ], "deepnote_to_be_reexecuted": false, "execution_millis": 264, "execution_start": 1643042236060, "source_hash": "ebb93218", "tags": [] }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, "execution_count": 59, "metadata": {}, "output_type": "execute_result" } ], "source": [ "alt.Chart(df2).mark_circle().encode(\n", " x = \"Energy\",\n", " y = \"Loudness\",\n", " color = \"Danceability\"\n", ")" ] }, { "cell_type": "code", "execution_count": 63, "metadata": { "cell_id": "6db416a2-c753-4a89-8b0e-3e05fbd3cf7d", "deepnote_cell_type": "code", "deepnote_output_heights": [ 356 ], "deepnote_to_be_reexecuted": false, "execution_millis": 428, "execution_start": 1643042425383, "source_hash": "4fd37989", "tags": [] }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, "execution_count": 63, "metadata": {}, "output_type": "execute_result" } ], "source": [ "alt.Chart(df2).mark_circle().encode(\n", " x = \"Energy\",\n", " y = \"Loudness\",\n", " color = alt.Color(\"Tempo\",scale=alt.Scale(scheme=\"Turbo\")),\n", " tooltip = \"Artist\"\n", ")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "cell_id": "5aaacbfd-c28b-4869-bd28-9c3c0ce96469", "deepnote_cell_type": "code", "tags": [] }, "outputs": [], "source": [ "# Are these the same\n", "# [\"Artist\"] vs list(\"Artist\")\n", "# No, list(\"Artist\") it's the characters" ] }, { "cell_type": "code", "execution_count": 67, "metadata": { "cell_id": "1d092afa-1aad-4a4b-8276-10988d518cb0", "deepnote_cell_type": "code", "deepnote_output_heights": [ 21 ], "deepnote_to_be_reexecuted": false, "execution_millis": 4, "execution_start": 1643042674066, "source_hash": "e40f4726", "tags": [] }, "outputs": [ { "data": { "text/plain": [ "['A', 'r', 't', 'i', 's', 't']" ] }, "execution_count": 67, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list(\"Artist\")" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "cell_id": "13dc4d7e-2df0-44b5-a71c-6aee0ea5e382", "deepnote_cell_type": "code", "deepnote_to_be_reexecuted": false, "execution_millis": 5, "execution_start": 1643042700736, "source_hash": "5db9a610", "tags": [] }, "outputs": [], "source": [ "sel = alt.selection_multi(fields=[\"Artist\"])" ] }, { "cell_type": "code", "execution_count": 69, "metadata": { "cell_id": "21cc6aaa-e813-47db-92e8-3c2e9cbf5312", "deepnote_cell_type": "code", "deepnote_to_be_reexecuted": false, "execution_millis": 8, "execution_start": 1643042716273, "source_hash": "b4c03d17", "tags": [] }, "outputs": [], "source": [ "c1 = alt.Chart(df2).mark_circle().encode(\n", " x = \"Energy\",\n", " y = \"Loudness\",\n", " color = alt.Color(\"Tempo\",scale=alt.Scale(scheme=\"Turbo\")),\n", " tooltip = \"Artist\"\n", ").add_selection(\n", " sel\n", ")" ] }, { "cell_type": "code", "execution_count": 70, "metadata": { "cell_id": "bac9c56c-832f-48db-9bed-db39c6837949", "deepnote_cell_type": "code", "deepnote_to_be_reexecuted": false, "execution_millis": 4, "execution_start": 1643042744173, "source_hash": "ab7eac5b", "tags": [] }, "outputs": [], "source": [ "c2 = alt.Chart(df2).mark_circle().encode(\n", " x = \"Energy\",\n", " y = \"Loudness\",\n", " color = alt.Color(\"Tempo\",scale=alt.Scale(scheme=\"Turbo\")),\n", " tooltip = \"Artist\"\n", ").transform_filter(\n", " sel\n", ")" ] }, { "cell_type": "code", "execution_count": 71, "metadata": { "cell_id": "b24d5543-56b2-4773-9e40-072c56a9e186", "deepnote_cell_type": "code", "deepnote_output_heights": [ 358 ], "deepnote_to_be_reexecuted": false, "execution_millis": 350, "execution_start": 1643042751784, "source_hash": "264bd2a2", "tags": [] }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "" ], "text/plain": [ "alt.HConcatChart(...)" ] }, "execution_count": 71, "metadata": {}, "output_type": "execute_result" } ], "source": [ "c1|c2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Try clicking on one or more of the points in the following chart. (Hold down shift while clicking to select multiple points.)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "cell_id": "070337ce-309b-43a6-90a9-bf41e2f0c07b", "deepnote_cell_type": "code", "deepnote_output_heights": [ 361 ], "deepnote_to_be_reexecuted": false, "execution_millis": 473, "execution_start": 1643043018973, "source_hash": "8db68b2d", "tags": [] }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "" ], "text/plain": [ "alt.Chart(...)" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "c3 = alt.Chart(df2).mark_circle().encode(\n", " x = \"Energy\",\n", " y = \"Loudness\",\n", " color = alt.Color(\"Tempo\",scale=alt.Scale(scheme=\"Turbo\")),\n", " opacity = alt.condition(sel,alt.value(1),alt.value(0.2)),\n", " size = alt.condition(sel,alt.value(400),alt.value(10)),\n", " tooltip = \"Artist\"\n", ").add_selection(\n", " sel\n", ")\n", "\n", "c3" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "deepnote": { "is_reactive": false }, "deepnote_execution_queue": [], "deepnote_notebook_id": "88671498-d573-4334-8e2d-f146a320dcb7", "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "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.9.9" } }, "nbformat": 4, "nbformat_minor": 2 }