Groupby value counts on the dataframe pandas
Groupby value counts on the dataframe pandas Question: I have the following dataframe: df = pd.DataFrame([ (1, 1, ‘term1’), (1, 2, ‘term2’), (1, 1, ‘term1’), (1, 1, ‘term2’), (2, 2, ‘term3’), (2, 3, ‘term1’), (2, 2, ‘term1’) ], columns=[‘id’, ‘group’, ‘term’]) I want to group it by id and group and calculate the number of …
Total answers: 6