Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/pydata/xarray
/ weighted_mean
Method
weighted_mean
xarray/tests/test_datatree.py:1122–1123 ·
view source on GitHub ↗
(ds)
Source
from the content-addressed store, hash-verified
1120
dt = DataTree(dataset=a)
1121
1122
def
weighted_mean(ds):
1123
return
ds.weighted(ds.area).mean([
"x"
,
"y"
])
1124
1125
weighted_mean(dt.dataset)
1126
Callers
nothing calls this directly
Calls
2
mean
Method · 0.45
weighted
Method · 0.45
Tested by
no test coverage detected