The groupby() method in pandas is used to:
-
A
merge two DataFrames on a common key
-
B
split data into groups and apply an aggregation
Correct answer
-
C
convert one column type into another numeric type
-
D
sort the rows of a DataFrame by value
Correct answer
B. split data into groups and apply an aggregation
14 views
Explanation
groupby implements the split-apply-combine pattern for aggregate analysis.
Reference
Asked in: NTS, PPSC IT, Interviews
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ