Python Pandas3 Flashcards

1
Q

How do you create aggregates in Pandas?

A

Use the groupby function, for example, df.groupby(‘Company’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you get a bunch of descriptive statistics?

A

With describe. df.groupby(‘Company’).describe().transpose

How well did you know this?
1
Not at all
2
3
4
5
Perfectly