home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 612145002

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/pull/3862#issuecomment-612145002 https://api.github.com/repos/pydata/xarray/issues/3862 612145002 MDEyOklzc3VlQ29tbWVudDYxMjE0NTAwMg== 1217238 2020-04-10T17:56:04Z 2020-04-10T17:59:44Z MEMBER

In light of #3470 (comment) it seems like the next best thing would be to given assign_coords the optional ability to update the DataArray/DataSet in-place. Thoughts?

There's no need to use assign_coords. You can also just use normal assignment to a DataArray/Dataset or coords, e.g, python ds['time'] = new_values # good ds.coords['time'] = new_values # good ds.coords['time'].values = new_values # broken, disabled by this PR ds.coords['time'].values[:] = new_values # also buggy (but harder to disable)

This would probably be worth clarifying in the error message.

(Under the hood, assign_coords basically does the exactly same thing as assignment to coords, it just copies the Dataset/DataArray` first)

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