home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 381252806

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/2055#issuecomment-381252806 https://api.github.com/repos/pydata/xarray/issues/2055 381252806 MDEyOklzc3VlQ29tbWVudDM4MTI1MjgwNg== 1217238 2018-04-13T20:30:43Z 2018-04-13T20:30:43Z MEMBER

A) I am not sure if it is possible, but maybe add a proper error to such thing - try to assign values when using any of the indexing methods - would be great.

Yes, totally agreed that this would be ideal, but unfortunately I don't think this is possible. Pandas attempted something with its SettingWithCopy warnings, but in most cases I think those just add noise and warm about something that isn't actually a problem.

B) if A is not possible, maybe in the DataArray page you should repeat the Warning.

I don't know if it makes sense on the overview page for DataArray, but we should definitely repeat it on the doc page for DataArray.sel: http://xarray.pydata.org/en/stable/generated/xarray.DataArray.sel.html

C) you should add to the text of the Warning to use vectorized indexing, so people know how to fix the issue.

Yes, agreed!

D) Also for the vectorized indexing page, an example using .sel could help. For example, something like the following, which I think it should work (using your same dataArray within the vectorized indexing help)

Yes, I think we should add an example of using vectorized indexing for assignment.

We already have some examples of using it with .sel() further down the page, but I agree that label-based indexing should probably be more strongly emphasized: http://xarray.pydata.org/en/stable/indexing.html#more-advanced-indexing

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