pandas dataframe crosstab

pd.crosstab(index = df['column1'], columns = df['column2'])
Anil Özkan