交叉表在大熊猫中正常化

时间:2020-01-27 10:22:16

标签: python-3.x pandas crosstab

df enter image description here

pd.crosstab(df.Sex ,[df.Nationality,df.Handedness],margins =True,margins_name = 'Total')

正在计算简单的交叉表 enter image description here 但是当我尝试将其标准化时显示错误

pd.crosstab(df.Sex ,[df.Nationality,df.Handedness],margins =True,margins_name = 'Total',normalize = True)

因为未在表中找到边距名称。 enter image description here

我如何规范交叉表?

0 个答案:

没有答案