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 am using Ubuntu 16, python 3.6, and xarary 0.9.5.
importnumpyasnpimportxarrayasxr# setup for a simple gridDX=50X=np.arange(0, 2010, DX)
Y=np.arange(0, 2010, DX)
Z=np.arange(0, 2010, DX)
grid_shape= (len(X), len(Y), len(Z))
# Create data arraydims='X Y Z'.split()
coords= {'X': X, 'Y': Y, 'Z': Z}
dar=xr.DataArray(np.ones(grid_shape), dims=dims, coords=coords)
# slice the data array so that all Z values are greater than 1000dar2=dar.loc[dar.Z>1000]
assertnp.all(dar2.Z>1000) # fails becase dar is sliced along X, not Z
Since the object returned from dar.Z > 1000 is a data array with "Z" as the only dim I would expect this to slice the "Z" dim rather than X.
The text was updated successfully, but these errors were encountered:
I am using Ubuntu 16, python 3.6, and xarary 0.9.5.
Since the object returned from dar.Z > 1000 is a data array with "Z" as the only dim I would expect this to slice the "Z" dim rather than X.
The text was updated successfully, but these errors were encountered: