home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1465227486

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/6870#issuecomment-1465227486 https://api.github.com/repos/pydata/xarray/issues/6870 1465227486 IC_kwDOAMm_X85XVZje 43316012 2023-03-12T15:25:47Z 2023-03-12T15:27:31Z COLLABORATOR

This is actually a bug in Dataset.reduce, it will drop the time index as well. See this example: ```python da = xr.DataArray([[1, 2, 3], [4, 5, 6]], dims=["x", "y"], coords={"x": [5, 6]}) da.reduce(lambda x, _, *__: x, dim="x") # has time coord

ds = xr.Dataset({"a": da}) ds.reduce(lambda x, _, *__: x, dim="x") # lost time coord ```

Probably the assumtion when writing this code was that the passed function actually reduces the dim.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  1326238990
Powered by Datasette · Queries took 0.634ms · About: xarray-datasette