Answers for "python - create frequency table between two columns"

0

python - create frequency table between two columns

pd.crosstab(df.column_1, df.column_2)
Posted by: Guest on October-28-2020
0

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)
Posted by: Guest on October-28-2020

Code answers related to "python - create frequency table between two columns"

Python Answers by Framework

Browse Popular Code Answers by Language