home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 623872328

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
623872328 MDU6SXNzdWU2MjM4NzIzMjg= 4091 Impossible to define variable as an index when the variable has only 1 value 4946109 closed 0     3 2020-05-24T14:10:57Z 2023-08-30T07:13:16Z 2023-08-30T07:13:16Z NONE      

I have several Datasets with this kind of coordinates. Time is not a dimension but I want to merge then following this variable.

python <xarray.Dataset> Dimensions: (latitude: 721, longitude: 1440) Coordinates: number int64 0 time datetime64[ns] 2019-09-01 step timedelta64[ns] 00:00:00 isobaricInhPa int64 1000 * latitude (latitude) float64 90.0 89.75 89.5 ... -89.5 -89.75 -90.0 * longitude (longitude) float64 0.0 0.25 0.5 0.75 ... 359.2 359.5 359.8 valid_time datetime64[ns] 2019-09-01 Data variables: t (latitude, longitude) float32 ... I tried to create an index using the time variable, so I can later merge the data. python ds = data.set_index({'time': 'time'})

I'm expecting to get this: python <xarray.Dataset> Dimensions: (latitude: 721, longitude: 1440) Coordinates: number int64 0 * time datetime64[ns] 2019-09-01 step timedelta64[ns] 00:00:00 isobaricInhPa int64 1000 * latitude (latitude) float64 90.0 89.75 89.5 ... -89.5 -89.75 -90.0 * longitude (longitude) float64 0.0 0.25 0.5 0.75 ... 359.2 359.5 359.8 valid_time datetime64[ns] 2019-09-01 Data variables: t (latitude, longitude) float32 ... But I get this error: python Exception has occurred: TypeError DatetimeIndex() must be called with a collection of some kind, numpy.datetime64('2019-11-01T00:00:00.000000000') was passed (Presumably due to the unique value in the time variable) How to merge then in this case ? How to avoid overwriting data because the library use only latitude and longitude and not time ?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4091/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.775ms · About: xarray-datasette