Skip to content

Commit c8d9015

Browse files
committed
fix: device mismatch in stats/nanaverage
1 parent b5055b0 commit c8d9015

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/earthkit/meteo/stats/array/numpy_extended.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def nanaverage(data, weights=None, **kwargs):
3737
if weights is not None:
3838
weights = xp.asarray(weights)
3939
# set weights to nan where data is nan:
40-
this_weights = xp.ones(data.shape) * weights
40+
this_weights = xp.ones_like(data) * weights
4141
this_weights[xp.isnan(data)] = xp.nan
4242
# Weights must be scaled to the sum of valid
4343
# weights for each relevant axis:

0 commit comments

Comments
 (0)