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
Calling the weekday_name such as: da.dt.weekday_name
raises an exception.
Looking into it more deeply, i.e. xarray source it can be seen the values are converted to a Pandas Series and the attribute called directly from that series.
day_name() accepts a locale, and if not provided, defaults to 'en_US.utf8'.
Pandas also have the month_name() method which may be worth implementing at the same time.
Alternatively, if locale implementation is not desired, weekday_name should be depreciated and removed as Pandas > v1.5 is required.
Thanks for opening your first issue here at xarray! Be sure to follow the issue template!
If you have an idea for a solution, we would really welcome a Pull Request with proposed changes.
See the Contributing Guide for more.
It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better.
Thank you!
What happened?
Calling the
weekday_name
such as:da.dt.weekday_name
raises an exception.
Looking into it more deeply, i.e. xarray source it can be seen the values are converted to a Pandas Series and the attribute called directly from that series.
This attribute was removed from Pandas in v1.0.0
It was replaced with the method day_name() - so the code would need to consider this case separately.
What did you expect to happen?
Return the weekday_name.
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?
day_name() accepts a locale, and if not provided, defaults to 'en_US.utf8'.
Pandas also have the month_name() method which may be worth implementing at the same time.
Alternatively, if locale implementation is not desired, weekday_name should be depreciated and removed as Pandas > v1.5 is required.
Environment
INSTALLED VERSIONS
commit: None
python: 3.12.0 (main, Oct 5 2023, 15:52:37) [Clang 14.0.3 (clang-1403.0.22.14.1)]
python-bits: 64
OS: Darwin
OS-release: 22.6.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: None
LOCALE: (None, 'UTF-8')
libhdf5: None
libnetcdf: None
xarray: 2023.12.0
pandas: 2.1.4
numpy: 1.26.2
scipy: None
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: None
nc_time_axis: None
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: None
cartopy: None
seaborn: None
numbagg: None
fsspec: None
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 68.2.2
pip: 23.3.1
conda: None
pytest: 7.4.3
mypy: None
IPython: None
sphinx: None
The text was updated successfully, but these errors were encountered: