Grokking the Data Engineering Interview
0% completed
Grouping and Aggregating in Python
Given a list of shipment records, how would you report the total weight that each warehouse shipped? The answer takes two steps. First, collect the records that share a warehouse into one group (grouping). Then reduce each group to the numbers the report needs, such as a count, a sum, or a maximum (aggregating).
SQL does both steps in one GROUP BY clause, as Window Functions showed. Python has no GROUP BY, so the program has to choose a structure that holds the groups
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%