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
What happened:
I am attempting to mask specific time_bnds coordinate points using loc, but am receiving TypeError: '_ElementwiseFunctionArray' object does not support item assignment.
This happens with datasets that have encoded (raw) time coordinates, then decoding with xr.decode_cf() before attempting to mask the time_bnds.
What you expected to happen:
The time_bnds coordinate points selected using .loc should mask properly
Minimal Complete Verifiable Example:
MVCE 1 -- breaks with encoded time coordinates then decoded using xr.decode_cf()
What happened:
I am attempting to mask specific
time_bnds
coordinate points usingloc
, but am receivingTypeError: '_ElementwiseFunctionArray' object does not support item assignment
.This happens with datasets that have encoded (raw) time coordinates, then decoding with
xr.decode_cf()
before attempting to mask thetime_bnds
.What you expected to happen:
The
time_bnds
coordinate points selected using.loc
should mask properlyMinimal Complete Verifiable Example:
MVCE 1 -- breaks with encoded time coordinates then decoded using
xr.decode_cf()
MVCE 2 -- works fine with decoded time coordinates
Anything else we need to know?:
The workaround is to perform
.load()
afterxr.decode_cf()
Log Output
Environment:
Output of xr.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:34:54) [Clang 16.0.6 ]
python-bits: 64
OS: Darwin
OS-release: 22.6.0
machine: arm64
processor: arm
byteorder: little
LC_ALL: None
LANG: None
LOCALE: (None, 'UTF-8')
libhdf5: 1.14.3
libnetcdf: 4.9.2
xarray: 2024.3.0
pandas: 2.2.2
numpy: 1.26.4
scipy: 1.13.0
netCDF4: 1.6.5
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.6.3
nc_time_axis: 1.4.1
iris: None
bottleneck: None
dask: 2024.4.2
distributed: 2024.4.2
matplotlib: 3.8.4
cartopy: None
seaborn: None
numbagg: None
fsspec: 2024.3.1
cupy: None
pint: None
sparse: 0.15.1
flox: None
numpy_groupies: None
setuptools: 69.5.1
pip: 24.0
conda: None
pytest: 8.2.0
mypy: 1.4.0
IPython: 8.22.2
sphinx: 7.3.7
/opt/miniconda3/envs/xcdat_dev/lib/python3.11/site-packages/_distutils_hack/init.py:26: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
The text was updated successfully, but these errors were encountered: