Plotting Percentages in Pandas

Hello all, I’m stuck trying to plot percentages from the following code. The code works as is…but if I try to plot it, plt.bar or any other chart, I get an error.

SMS_noshow = df.groupby([“SMS_received”])
SMS_noshow=pd.crosstab(df[‘Gender’],df[‘SMS_received’]).apply(lambda r: r/r.sum(), axis=1)
SMS_noshow

I’m also hoping to adjust the following code to show the percentage of males and females that received a text message reminder but didn’t show up for an appointment. Again using the crosstab documentation from this page(https://pandas.pydata.org/pandas-docs/version/0.23.4/generated/pandas.crosstab.html), but even the percentages aren’t working on this one.

SMS_noshow=pd.crosstab(df[‘Gender’],df[“SMS_received, Noshow”]).apply(lambda r: r/r.sum(), axis=1)

© Copyright 2013-2019 Analytics Vidhya