home_team_name home_team_goal_count
0 Bayern München 2
1 Bayern München 2
2 Bayern München 1
3 Köln 2
4 Köln 2
I groupby the data on the variable home_team_name.
df.groupby("home_team_name")
The values of home_team_goal_count can only be 2 or 1. I want to get the minimum number of occurrences
of the values in each group. The result I would want is 1 for Bayern Munchen and 0 for Koln. To illustrate Bayern Munchen has 2 times 2 and 1 times 1, therefore the minimum is 1. Koln has 2 times 2 and 0 time 1 therefore the minimum is 0.