issues: 341643235
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
341643235 | MDU6SXNzdWUzNDE2NDMyMzU= | 2292 | Support non-string dimension/variable names | 3888181 | open | 0 | 18 | 2018-07-16T19:15:13Z | 2021-11-26T07:52:42Z | NONE | Problem descriptionCurrently, it appears that "dimension"/"coordinate" labels must be strings. However, in more rigorous software engineering applications it is often desirable to use something more organized/structured for labels, e.g. enums. I think it would be great if Obviously storing to e.g. NetCDF necessitates string-valued field names, so I would think calling Code sample```python import enum import numpy as np import pandas as pd import xarray as xr class CoordId(enum.Enum): LAT = 'lat' LON = 'lon' pd.DataFrame({CoordId.LAT: [1,2,3]}).to_csv() Returns: ',CoordId.LAT\n0,1\n1,2\n2,3\n'xr.DataArray( data=np.arange(3 * 2).reshape(3, 2), coords={CoordId.LAT: [1, 2, 3], CoordId.LON: [7, 8]}, dims=[CoordId.LAT, CoordId.LON], ) Fails: TypeError: dimension CoordId.LAT is not a string``` Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2292/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | issue |