📅  最后修改于: 2022-03-11 14:46:02.851000             🧑  作者: Mango
# Solution 1
df_solution = df.pivot_table(index=['Column_1', 'Column_2'], aggfunc='size')
# Solution 2
pd.crosstab(df.Column_1, df.Column_2)