issues: 490618213
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
490618213 | MDU6SXNzdWU0OTA2MTgyMTM= | 3291 | xr.DataSet.from_dataframe / xr.DataArray.from_series does not preserve DateTimeIndex with timezone | 923438 | open | 0 | 4 | 2019-09-07T10:10:40Z | 2021-04-21T21:00:41Z | NONE | Problem DescriptionWhen using DataSet.from_dataframe (DataArray.from_series) to convert a pandas dataframe with DateTimeIndex having a timezone - xarray convert the datetime into a nanosecond index - rather than keeping it as a datetime-index type. MCVE Code Sample
Expected OutputAfter removing the tz localization from the DateTimeIndex of the dataframe , the conversion to a DataSet preserves the time-index (without converting it to nanoseconds)
Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3291/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | issue |