Write a function that calculates the value_counts in the decade pandas dataframe column if the rows in the rating column = 5.0 if av_rating[av_rating.rating == 5.0]: av_rating['decade'].value_counts() else: pass
def value_counts(df, year): if df[df['rating'] == 5.0]: return df["year"].value_counts() else: return "no movie with 5.0 rating in this year"