-
Hi there! I have a question about the chunking behaviour when using idxmin / idxmax for a chunked array. What is the expected behaviour for the chunks after we run import numpy as np
import xarray as xr
# create some dummy data and chunk
x, y, t = 1000, 1000, 57
rang = np.arange(t*x*y)
da = xr.DataArray(rang.reshape(t, x, y), coords={'time':range(t), 'x': range(x), 'y':range(y)})
da = da.chunk(dict(time=-1, x=256, y=256)) Now when I look at the array, it looks something like this: da.idxmin('time') But after doing My understanding is that it seems to be trying to keep the size of chunks small, But oddly, when we do it for floats: da = da.astype('float32') before and after doing the Is this the expected behavour for this operation? I'm guessing the reshaping in the source code happens here, but I haven't been able to figure out how yet. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Just for context for people finding this in the future, @dcherian picked this up almost immediately (thanks!) in #9425 , which I didn't realise until know. (marking as answered since there's a PR about it) |
Beta Was this translation helpful? Give feedback.
Just for context for people finding this in the future, @dcherian picked this up almost immediately (thanks!) in #9425 , which I didn't realise until know.
(marking as answered since there's a PR about it)