Maybe groupby is the wrong approach. Seems like it should work but I'm not seeing it...
I want to group an event by it's outcome. Here is my DataFrame (df):
Status Event
SUCCESS Run
SUCCESS Walk
SUCCESS Run
FAILED Walk
Here is my desired result:
Event SUCCESS FAILED
Run 2 1
Walk 0 1
I'm trying to make a grouped object but I can't figure out how to call it to display what I want.
grouped = df['Status'].groupby(df['Event'])
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…