issues: 1584580877
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1584580877 | I_kwDOAMm_X85ecskN | 7527 | DataArray.idxmax converts coordinates into float64 by default | 34257249 | open | 0 | 0 | 2023-02-14T17:45:07Z | 2023-02-14T17:51:33Z | CONTRIBUTOR | What happened?Same example as in DataArray.idxmax but instead we look at the "y" dimension.
The starting "y" coordinates are of type int: The return values of argmax are of type int64: good. The return values of idxmax are of type float64: bad. What did you expect to happen?If no fillna operation must occur, then the return values of idxmax should be the same type as from the input. Else, the return type might change to a new type depending on the type of the filled value. Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output```Python In [41]: print(array.argmax(dim="y").dtype) int64 In [42]: print(array.idxmax(dim="y").dtype) float64 ``` Anything else we need to know?Suggestions:
- change these two lines:
Environment
INSTALLED VERSIONS
------------------
commit: None
python: 3.9.13 (main, Aug 25 2022, 23:51:50) [MSC v.1916 64 bit (AMD64)]
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 158 Stepping 13, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: ('English_United States', '1252')
libhdf5: 1.10.6
libnetcdf: None
xarray: 0.20.1
pandas: 1.4.4
numpy: 1.24.2
scipy: 1.9.1
netCDF4: None
pydap: None
h5netcdf: None
h5py: 3.7.0
Nio: None
zarr: 2.13.3
cftime: None
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: 1.3.5
dask: 2022.7.0
distributed: 2022.7.0
matplotlib: 3.5.2
cartopy: None
seaborn: 0.11.2
numbagg: None
fsspec: 2022.7.1
cupy: None
pint: None
sparse: None
setuptools: 63.4.1
pip: 23.0
conda: 22.9.0
pytest: 7.1.2
IPython: 7.31.1
sphinx: 5.0.2
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/7527/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | issue |