Generation

generate functionTue, 24 Jan 2023

Write a pandas function that groups matching columns traffic_source and region and outputs the values of the third column source_type for them

def group_by_two_columns(dataframe, col1, col2, col3): return df.groupby(['col1','col2'])['col3'].value_counts()

Want to kickstart your project?Use the new AI Studio to create your code