Icon

Challenge 11 - Let's Dance

<p><strong>Level:</strong> Medium</p><p><strong>Description:</strong><br>As a data-driven DJ, you’re tasked with curating the perfect playlist to keep the crowd dancing nonstop during a two-hour event focused on Indian music. The dataset you’re using comprises songs from 15 Indian languages, giving you a diverse range of tracks to work with. Your goal is to select songs with the highest danceability scores, ensuring that each track contributes to an energetic atmosphere throughout the event. You’ll use the dataset from Kaggle to choose the best tracks, sort them by danceability, calculate cumulative durations, and filter the playlist to stay within the two-hour limit.</p><p><strong>Beginner-Friendly Objective(s):</strong></p><ol><li><p>Load and preprocess the data (If you struggle to combine the CSV files, you can find a pre-joined dataset in the current workflow's datasera folder).</p></li><li><p>Sort the songs based on their danceability scores, focusing on the highest scores first.</p></li></ol><p><strong>Intermediate-Friendly Objective(s):</strong></p><ol><li><p>Import multiple CSV files using a loop structure.</p></li><li><p>Sort the songs based on their danceability scores, focusing on the highest scores first.</p></li><li><p>Convert song durations from "HH:MM" format to total seconds.</p></li><li><p>Calculate cumulative durations, starting from the top songs.</p></li><li><p>Filter the songs to ensure the total playlist duration does not exceed two hours.</p></li></ol><p><strong>Dataset:</strong> Spotify Indian Languages Dataset</p>

URL: dataset https://www.kaggle.com/datasets/gayathripullakhandam/spotify-indian-languages-datasets

The solution involves a series of data processing steps to create a playlist of songs that fits within a two-hour duration. The workflow begins by listing files in a specified directory and reading song data from a CSV file. It then sorts the songs by danceability and converts their durations into seconds. The "Moving Aggregator" node is is used to calculate cumulative durations, and a filter is applied to ensure the total duration does not exceed two hours. The final output is a table view displaying the list of selected songs.

Challenge 11 - Let's Dance


Level: Medium

Description:
As a data-driven DJ, you’re tasked with curating the perfect playlist to keep the crowd dancing nonstop during a two-hour event focused on Indian music. The dataset you’re using comprises songs from 15 Indian languages, giving you a diverse range of tracks to work with. Your goal is to select songs with the highest danceability scores, ensuring that each track contributes to an energetic atmosphere throughout the event. You’ll use the dataset from Kaggle to choose the best tracks, sort them by danceability, calculate cumulative durations, and filter the playlist to stay within the two-hour limit.

Beginner-Friendly Objective(s):

  1. Load and preprocess the data (If you struggle to combine the CSV files, you can find a pre-joined dataset in the current workflow's datasera folder).

  2. Sort the songs based on their danceability scores, focusing on the highest scores first.

Intermediate-Friendly Objective(s):

  1. Import multiple CSV files using a loop structure.

  2. Sort the songs based on their danceability scores, focusing on the highest scores first.

  3. Convert song durations from "HH:MM" format to total seconds.

  4. Calculate cumulative durations, starting from the top songs.

  5. Filter the songs to ensure the total playlist duration does not exceed two hours.

Dataset:Spotify Indian Languages Dataset

Hint for Beginners

ensure the playlist < 7200 seconds
Row Filter
display playlist
Table View
compute playlist duration from the top
Moving Aggregator
songs from 15 Indian languages
Import Files
joined dataset
CSV Reader
convert duration in seconds
Expression
keep only useful columns
Column Filter
Sort the table bydanceability indescending order
Sorter

Nodes

Extensions

Links