-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Datetime as coordinaets does not convert back to datetime (returns int) #4880
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
Comments
Thanks for clear example. As per @keewis 's label, this does look like an upstream issue. |
yes, I believe this to be a date_frame.coords['time'].data[0] returns a |
Yes, I created that issue :), should this then be closed? |
Possibly, if this doesn't require any action from us. @spencerkclark, what do you think? |
Yes I think unfortunately there is not much we can do here, since as @keewis noted, This issue in general is a little tricky since xarray and pandas use nanosecond-precision datetime values, but |
Closing as dupe of #3256 |
What happened:
datetime was in
np.datetime64
formet. When converted tdatetime.datetime
format it returned anint
What you expected to happen:
`to get a datetime returned
Minimal Complete Verifiable Example:
output:
if converted to int, it also gives different lengths of int :
date_frame:
946684800000000000
946684800000000
normal datetime64^
Anything else we need to know?:
it is also mentioned in this SO thread appears to be a problem in the datetime64....
numpy version 1.20.0
pandas version 1.2.1
Environment:
Output of xr.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.7.9 | packaged by conda-forge | (default, Dec 9 2020, 21:08:20)
[GCC 9.3.0]
python-bits: 64
OS: Linux
OS-release: 5.4.0-59-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
libhdf5: None
libnetcdf: None
xarray: 0.16.2
pandas: 1.2.1
numpy: 1.20.0
scipy: None
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: 2.6.1
cftime: None
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: 2021.01.1
distributed: 2021.01.1
matplotlib: None
cartopy: None
seaborn: None
numbagg: None
pint: None
setuptools: 49.6.0.post20210108
pip: 21.0.1
conda: None
pytest: None
IPython: 7.20.0
sphinx: None
The text was updated successfully, but these errors were encountered: