We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReturnDataView
xarray.DataArray
I think changing from plain numpy arrays to xarray.DataArray for all data in ReturnDataView would be quite nice:
This should be fully backwards-compatible.
# to happen inside ReturnDataView import xarray as xr import numpy as np sx = xr.DataArray( np.random.randn(2, 3, 2), dims=("time", "observable", "parameter"), coords=dict(time=[0, 10], observable=["obs1", "obs2", "obs3"], parameter=["p1", "p2"]) ) # suggestion: # sx = rdata.sx # allows for much more convenient slicing, e.g. sx.sel(time=10, observable="obs2", parameter="p1") print(sx) <xarray.DataArray (time: 2, observable: 3, parameter: 2)> array([[[ 1.17411809, -1.06761371], [-0.20386803, -0.11627882], [-1.61609636, 0.15455949]], [[ 0.90712023, -0.4521838 ], [ 1.40426045, -0.35439355], [-0.36240905, 2.25663359]]]) Coordinates: * time (time) int64 0 10 * observable (observable) <U4 'obs1' 'obs2' 'obs3' * parameter (parameter) <U2 'p1' 'p2'
The text was updated successfully, but these errors were encountered:
Oh sounds nice, didn't know about xarrays!
Sorry, something went wrong.
No branches or pull requests
I think changing from plain numpy arrays to
xarray.DataArray
for all data inReturnDataView
would be quite nice:This should be fully backwards-compatible.
The text was updated successfully, but these errors were encountered: