trying to plot density with kdeplot. However, I can not get it to work exactly how I would like.
data = customers groupby gender
if I code
customers.hist(by ='gender', column='total_trans_ct', figsize = [10,6]);```
I get a histogram divided for M and F clients in the dataset. However, I want a density plot so I created
sns.kdeplot(data=customers, x="total_trans_ct", hue="attrition_flag", fill=True, common_norm=False, alpha=0.4);
Which gives me the plot that I want. However, I can't figure out how to divide it into F and M. can anyone please hint how to continue?
I tried the follwing and did not work either
plot = sns.PairGrid(customers['gender'],hue="attrition_flag")
plot = plot.map(sns.kdeplot(data=customers, x="total_trans_ct", fill=True, common_norm=False, alpha=0.4))
when using **kwargs returns error, kwargs not defined