python - create frequency table between two columns code example
Example 1: python - create frequency table between two columns
# Solution 1
df_solution = df.pivot_table(index=['Column_1', 'Column_2'], aggfunc='size')
# Solution 2
pd.crosstab(df.Column_1, df.Column_2)
Example 2: python - create frequency table between two columns
pd.crosstab(df.column_1, df.column_2)