home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 137182504

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/557#issuecomment-137182504 https://api.github.com/repos/pydata/xarray/issues/557 137182504 MDEyOklzc3VlQ29tbWVudDEzNzE4MjUwNA== 1217238 2015-09-02T17:37:56Z 2015-09-02T17:37:56Z MEMBER

Currently, the way to do this is to create a boolean indexer, with something like the following:

pr_dataset.sel(time=np.in1d(pr_dataset['time.year'], elnino_years))

I agree that this is overly verbose and we can come up with something better. I'm not quite happy with selyear, though: - It's ambiguous which datetime variable the year refers do (there can be more than one time variable on some datasets). - I'm also not a big fan of adding a bunch of new API methods that are datetime specific -- it creates a lot of noise (pandas has an issue with this).

Something like pr_dataset.sel(year=elnino_years) would be the ideal fix for this second concern (we've discussed this in another issue, can't remember which one now), but it's still ambiguous which time variable it refers to.

So, some other possible ways to spell this: 1. pr_dataset.sel('time', year=elnino_years) 2. pr_dataset.sel('time.year', elnino_years) 3. pr_dataset.sel.time.year(elnino_years)

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