-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
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
Indexing a datetime64[ns] coordinate with a scalar datetime.date produces a KeyError #4363
Labels
Comments
seth-p
changed the title
Indexing a datetime64[ns] coordinate with a datetime.date object produces a KeyError
Indexing a datetime64[ns] coordinate with a scalar datetime.date object produces a KeyError
Aug 22, 2020
seth-p
changed the title
Indexing a datetime64[ns] coordinate with a scalar datetime.date object produces a KeyError
Indexing a datetime64[ns] coordinate with a scalar datetime.date produces a KeyError
Aug 26, 2020
2 tasks
This doesn't work in pandas either:
I think it is reasonable to expect a |
Indeed, this is reported in pandas-dev/pandas#35466 (comment) and pandas-dev/pandas#35830. Also pandas-dev/pandas#35478. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Indexing a
datetime64[ns]
coordinate with a scalardatetime.date
produces aKeyError
([6]
).Curiously, indexing with a
datetime.date
slice does work ([5]
).I would expect
[6]
to work just like[4]
.This may well be related to (or a duplicate of) #3736, #4283, #4292, #4306, #4319, or #4370, but none of those actually mentions
datetime.date
objects, so I can't tell.Environment:
Output of xr.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.7.8 | packaged by conda-forge | (default, Jul 31 2020, 02:25:08)
[GCC 7.5.0]
python-bits: 64
OS: Linux
OS-release: 3.10.0-693.el7.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
libhdf5: 1.10.6
libnetcdf: 4.7.4
xarray: 0.16.0
pandas: 1.1.0
numpy: 1.19.1
scipy: 1.5.2
netCDF4: 1.5.4
pydap: None
h5netcdf: 0.8.1
h5py: 2.10.0
Nio: None
zarr: None
cftime: 1.2.1
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: 1.3.2
dask: 2.23.0
distributed: 2.23.0
matplotlib: 3.3.1
cartopy: None
seaborn: 0.10.1
numbagg: installed
pint: None
setuptools: 49.6.0.post20200814
pip: 20.2.2
conda: 4.8.4
pytest: None
IPython: 7.17.0
sphinx: None
The text was updated successfully, but these errors were encountered: