Aug-01-2020, 06:03 PM
Hi All,
I can't find a button where I can upload pictures? There is one where I can put a link, but I don't have a link.
I'll have to try to explain it.
ns is my table of patients. I am trying to do some analysis on Gender and whether they showed up or not:
I am grouping as follows:
Now I get propotional values:
1) The pie charts now have a y = "Age" from before. I cannot change it to Male/Femal even if I put y = 'Male' in the code. How do I force the label?
2) My two pie charts overlap each other. Is there a way to move one of the pie charts to the right?
Thanks in advance. Sorry I have just started learning coding and am an absolute beginner!
I can't find a button where I can upload pictures? There is one where I can put a link, but I don't have a link.
I'll have to try to explain it.
ns is my table of patients. I am trying to do some analysis on Gender and whether they showed up or not:
I am grouping as follows:
ns_gender = ns.groupby(['Gender','No_show']).count()['Age']I am taking the "Age" column as an arbitrary column to retrieve the counts. However this poses a problem further on.
Now I get propotional values:
mal_prop = ns_gender['M'] / gender_tots['M'] fem_prop = ns_gender['F'] / gender_tots['F']Now I plot pie charts:
mal_prop.plot.pie(subplots = True, figsize=(5, 5),autopct='%1.1f%%'), fem_prop.plot.pie(subplots = True, figsize=(5, 5),autopct='%1.1f%%')I have two issues:
1) The pie charts now have a y = "Age" from before. I cannot change it to Male/Femal even if I put y = 'Male' in the code. How do I force the label?
2) My two pie charts overlap each other. Is there a way to move one of the pie charts to the right?
Thanks in advance. Sorry I have just started learning coding and am an absolute beginner!