del(triplet_datasettriplet_dataset_sub_song triplet_dataset_sub[triplet_dataset_sub song isin(song_subset)del(triplet_dataset_subtriplet_dataset_sub_song to_csv(path_or_buf=data_home+'triplet_dataset_sub_song csv'index falsethis subsetting will give us dataframe with around million rows of tuples we will use this as the starting dataset for our all future analyses you can play around with these numbers to arrive at different datasets and possibly different results enhancing the data the data we loaded is just the triplet data so we are not able to see the song namethe artist nameor the album names we can enhance our data by adding this information about the songs this information is part of the million song database this data is provided as sqlite database file first we will download the data by downloading the track_metadata db file from the web page at millionsong/pages/getting-dataset#subset the next step is to read this sqlite database to dataframe and extract track information by merging it with our triplet dataframe we will also drop some extra columns that we won' be using for our analysis the code snippet that follows will load the entire datasetjoin it with our subsetted triplet dataand drop the extra columns in [ ]conn sqlite connect(data_home+'track_metadata db'cur conn cursor(cur execute("select name from sqlite_master where type='table'"cur fetchall(out[ ][('songs',)the output of the above snippet shows that the database contains table named songs we will get all the rows from this table and read it into dataframe in [ ]del(track_metadata_df_sub['track_id']del(track_metadata_df_sub['artist_mbid']track_metadata_df_sub track_metadata_df_sub drop_duplicates(['song_id']triplet_dataset_sub_song_merged pd merge(triplet_dataset_sub_songtrack_metadata_ df_subhow='left'left_on='song'right_o ='song_id'triplet_dataset_sub_song_merged rename(columns={'play_count':'listen_ count'},inplace=truedel(triplet_dataset_sub_song_merged['song_id']del(triplet_dataset_sub_song_merged['artist_id']del(triplet_dataset_sub_song_merged['duration']del(triplet_dataset_sub_song_merged['artist_familiarity']del(triplet_dataset_sub_song_merged['artist_hotttnesss']del(triplet_dataset_sub_song_merged['track_ digitalid']del(triplet_dataset_sub_song_merged['shs_perf']del(triplet_dataset_sub_song_merged['shs_work']