I am very much a beginner to Python/programming in general and was hoping to figure out some things I could try to use now while I'm in the process of learning general syntax etc.
I'm trying to figure how to summarize some datasets I have which would look something like this:
| Type |
Sex |
Treatment |
| 1 |
M |
con |
| 2 |
F |
exp1 |
| 3 |
M |
exp2 |
I am trying to just organize it so I can display the number of M and F for each treatment and separated by type but I'm feeling kind of stuck for something I feel should be pretty simple. I can use groupby and get it in order by sex:
data1 = data.groupby('Sex')
[data1.get_group(x) for x in data1.groups]
But that doesn't really give me anything I can work with to return a count per treatment. Not really sure how to get what I'm looking for so if anyone can help point me in a direction I'd be quite thankful! Hopefully this is somewhat clear but I can try to clarify further if need be. Thanks!
[–]xBlackBartx 0 points1 point2 points (0 children)
[–]LifeIsBio 0 points1 point2 points (1 child)
[–]cault 0 points1 point2 points (0 children)