xarray icon indicating copy to clipboard operation
xarray copied to clipboard

Smarter Dataset quantile method?

Open ollie-bell opened this issue 4 months ago • 1 comments

What is your issue?

Calling ds.quantile(..., dim="x") result in all data variables in ds being modified to have a quantile dimension regardless of whether they had x as a dimension to begin with.

Is this intended? Can ds.quantile(..., dim="x") be called such that only data variables in ds that had x as a dimension end up with the x dimension being replaced by quantile dimension?

In my case I have a dimensionless data variable which I want to keep dimensionless. I know workaround are to either decode_coords="all" beforehand, or to do something like ds[my_dimensionless_var].isel(quantile=-1, drop=True) afterwards... but just checking if that is expected behaviour.

ollie-bell avatar Feb 15 '24 12:02 ollie-bell

Thanks, this is certainly not desired behavior. Similar to #7027.

mathause avatar Feb 17 '24 08:02 mathause