Generation

generate functionWed, 18 Jan 2023

Write a function that calculates the value_counts in the decade pandas column of the dataview if the rows in the rating column = 5.0

def five_star_decade_value_counts(df): df = df.loc[df.rating == 5.0] return df.decade.value_counts()

Questions about programming?Chat with your personal AI assistant