Exercise

Creating Dask dataframes from CSVs

Previously, you analyzed the Spotify song data using loops and delayed functions. Now you know that you can accomplish the same thing more easily using a Dask DataFrame. Let's see how much easier the same tasks you did earlier are if you do them using these methods instead of loops. First, however, you will need to load the dataset into a Dask DataFrame.

Instructions

100 XP
  • Import the dask.dataframe subpackage as dd.
  • Read all the CSV files in the data/spotify folder using a maximum blocksize of 1MB.
  • Use the dd.to_datetime() function to convert the strings in the 'release_date' column to datetimes.
  • Use the DataFrame's .head() method to show 5 rows of the table.