From 9cf0157d8332e5d6c43747020b1c4318bd2611c3 Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Tue, 3 Dec 2024 11:27:17 -0700 Subject: [PATCH] fix? --- xarray/core/computation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xarray/core/computation.py b/xarray/core/computation.py index f4b894ac913..29de030ac5f 100644 --- a/xarray/core/computation.py +++ b/xarray/core/computation.py @@ -2178,6 +2178,9 @@ def _calc_idxminmax( array[dim].data, chunks=((array.sizes[dim],),) ) coord = coord.copy(data=coord_array) + else: + coord = coord.copy(data=to_like_array(array[dim].data, array.data)) + res = indx._replace(coord[(indx.variable,)]).rename(dim) if skipna or (skipna is None and array.dtype.kind in na_dtypes):