home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 252490115

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
252490115 MDU6SXNzdWUyNTI0OTAxMTU= 1519 Assignment 946903 open 0     6 2017-08-24T05:22:13Z 2022-05-02T13:41:37Z   CONTRIBUTOR      

Assignment of individual elements / subsets seems to be only partially supported, but I have not found clear documentation on it. After playing a bit around with xarray I believe the current support boils down to the following (I list some issues I see with the current documentation and how things seem to work).

DataSet - Change a element in a associated DataArray - ds.loc[selector_dict].NAME_OF_VARIABLE = -1 Doesn't work but at least throws an error (Use __setitem__ style assignment (e.g., ds['name'] = ...) instead to assign variables.) - ds.loc[selector_dict]["NAME_OF_VARIABLE"] = -1 Silently fails - Is it possible to throw an exception as well? I believe this usage variant is "more common", as NAME_OF_VARIABLE may only be known at runtime. #974 May fix this (?). - Same goes for ds.sel

DataArray (Can be obtained via ds['name']) - Using .sel (which is documented to return a new DataArray, so arguably it's expected not to work) - ds["NAME_OF_VARIABLE"].sel(**selector_dict) = -1 Invalid python syntax - ds["NAME_OF_VARIABLE"].sel(**selector_dict).values = -1 Silently fails - Using .loc - ds["NAME_OF_VARIABLE"].loc[selector_dict] = -1 works

Is this the recommended behaviour? Then I believe the wrong pattern of ds.loc[selector_dict]["NAME_OF_VARIABLE"] = -1 should be documented and ds[NAME_OF_VARIABLE].loc[selector_dict] = -1 instead suggested.

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

Links from other tables

  • 4 rows from issues_id in issues_labels
  • 6 rows from issue in issue_comments
Powered by Datasette · Queries took 77.528ms · About: xarray-datasette