def count_tracks_by_artist(df, artist):
    """returns count of tracks given dataframe and artist name;
    dataframe has to have `name_artist` and `track_id` columns"""
    mask = df["name_artist"] == artist
    return df.loc[mask, "track_id"].count()