Python Pandas3 Flashcards
1
Q
How do you create aggregates in Pandas?
A
Use the groupby function, for example, df.groupby(‘Company’)
2
Q
How do you see the aggregate values?
A
First you define the groupby object and save it under a name, then you apply an aggregation function to it. For example. byComp=df.groupyby(‘Company’)
byComp.mean()
3
Q
How do you get a bunch of descriptive statistics?
A
With describe. df.groupby(‘Company’).describe().transpose