Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to display percentage in pandas crosstab

pd.crosstab(df.A,df.B, normalize='index')
    .round(4)*100

B          A      B      C
A                         
one    33.33  33.33  33.33
three  33.33  33.33  33.33
two    33.33  33.33  33.33
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #display #percentage #pandas #crosstab
ADD COMMENT
Topic
Name
3+1 =