我正在尝试使用当前输出的DataFrame'Gender'创建堆积的条形图:
Loan_Status N Y
Gender
Female 37 75
Male 150 339
我有以下代码,但出现错误:'No Axis Object Type命名为1'
Gender=pd.crosstab(train['Gender'],train['Loan_Status'])
Gender.div(Gender.sum(1).astype(float), axis=0).plot(kind="bar", stacked=True, figsize=(4,4))
ValueError: No axis named 1 for object type <class 'pandas.core.frame.DataFrame'>
希望有人可以帮助我:)