You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure how devs will feel about this, but I wanted to ask because I'm getting into this issue frequently.
Currently many methods such as .min(), .max(), .mean() returns a DataArray even for the cases where the return value is a scaler. For example,
importnumpyasnpimportxarrayasxrtest=xr.DataArray(data=np.ones((10, 10)))
In [6]: test.min()
Out[6]:
<xarray.DataArray ()>array(1.0)
which makes a lot of other things break down and I have to use test.min().values or float(test.min()).
I think it would be great that these methods return a scalar when the return value is a scaler. For example,