I have a csv file which contains Gender and Marriage status along with few more columns like below.
Loan_ID,Gender,Married,Dependents,Education,Self_Employe
You can use groupby + size and then use Series.plot.bar:
Difference between count and size.
groups = df.groupby(['Gender','Married']).size()
groups.plot.bar()
Another solution is add unstack for reshape or crosstab:
print (df.groupby(['Gender','Married']).size().unstack(fill_value=0))
Married No Yes
Gender
Female 80 31
Male 130 357
df.groupby(['Gender','Married']).size().unstack(fill_value=0).plot.bar()
Or:
pd.crosstab(df['Gender'],df['Married']).plot.bar()