home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 309378665

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
309378665 MDU6SXNzdWUzMDkzNzg2NjU= 2023 quantile method returns quantile coordinates which can raise issues 37420766 closed 0     9 2018-03-28T13:57:25Z 2020-03-28T16:51:17Z 2020-03-28T16:51:17Z NONE      

I browsed the issues to check whether there was an open issue on this, but didn't find anything. Apologies if it is a duplicate.

I am an happy user of the new quantile method in xarray. I think though that creating a coordinate that has the same name as the method can raise issues.

While updating my code to switch entirely to xarray and the quantile method, I realized that this could be an issue. In the old code I had some datasets created using np.nanpercentiles, in which I had generated the coordinate and named it "q". At some point in my code I have to retrieve the list of the q values, I used to do that by extracting the values:

python x = ds.q.values updating it to what would be the coordinate automatically generated by xarray, it should be

python x = ds.quantile.values

Problem description

But of course, when trying to call the coordinate "quantile" from the dataset, you get an Attribute Error:

python AttributeError: 'function' object has no attribute 'values' This can be easily solved by accessing the coordinate as:

python x = ds['quantile'].values

However, I thought to point out that using the same name for the coordinate and the method can raise this type of issues.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2023/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
  • 9 rows from issue in issue_comments
Powered by Datasette · Queries took 157.151ms · About: xarray-datasette