Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ActiveState/code
/ recipe-577535.py
File
recipe-577535.py
recipes/Python/577535_Aggregates_using_groupdefaultdict/recipe-577535.py:None–None ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1
#How to do aggregates using groupby, defaultdict and Counter on flat files
2
#This Example computes groups for:
3
#region, count(region), sum(sales), avg(sales), max(sales), min(sales)
4
#
Callers
nothing calls this directly
Calls
12
defaultdict
Class · 0.90
list
Class · 0.85
print
Function · 0.85
groupby
Class · 0.85
min
Function · 0.85
map
Function · 0.85
sorted
Function · 0.50
sum
Function · 0.50
max
Function · 0.50
Counter
Class · 0.50
append
Method · 0.45
items
Method · 0.45
Tested by
no test coverage detected