TIL: Counting values in Pandas

Currently working on a project in Python that requires aggregating data. This code returns a Pandas series:


Going further, you can filter the series to only show values with a certain count:

 pandas.value_counts(df['name'].values)[pandas.value_counts(df['name'].values) > 3]

Leave a Comment

Your email address will not be published. Required fields are marked *