Exemple #1
0
def df_purge_no_tag(merged_df: pd.DataFrame, lf: lastfm.LastFm):
    ''' Remove tracks which are not matched to any tag. '''

    tids_with_tag = lf.get_tids()
    tids_with_tag_df = pd.DataFrame(data={'track_id': tids_with_tag})

    return pd.merge(merged_df, tids_with_tag_df, on='track_id', how='inner')