I am able to run a count on the entire dataset easily using
import pandas as pd
data['eventcode'].value_counts()
which produces counts for all the unique values in the column 'eventcode'. Now I want to run the same count process but only where a different column has value 1. How should I go about this? Thanks in advance.