issue_comments
2 rows where author_association = "CONTRIBUTOR" and issue = 104484316 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
issue 1
- CDO-like convenience methods to select times · 2 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
427291294 | https://github.com/pydata/xarray/issues/557#issuecomment-427291294 | https://api.github.com/repos/pydata/xarray/issues/557 | MDEyOklzc3VlQ29tbWVudDQyNzI5MTI5NA== | markelg 6883049 | 2018-10-05T08:46:12Z | 2018-10-05T08:46:12Z | CONTRIBUTOR | I though this issue was long forgotten ; ) The fact is that today I still call this seltime function very often in my code so I am glad to see it back, thank you. I like the .isin(elnino_years) syntax, and I see that it is consistent with pandas. Something like dataset.time.year.isin(elnino_years) would be very nice too, right now is just a "to_index()" away, as this works: dataset.time.to_index().year.isin(elnino_years). However I am not sure about how this is related with multidimensional indexing, as time is only one dimension. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
CDO-like convenience methods to select times 104484316 | |
137478562 | https://github.com/pydata/xarray/issues/557#issuecomment-137478562 | https://api.github.com/repos/pydata/xarray/issues/557 | MDEyOklzc3VlQ29tbWVudDEzNzQ3ODU2Mg== | markelg 6883049 | 2015-09-03T15:05:35Z | 2015-09-04T09:49:54Z | CONTRIBUTOR | I agree with your arguments against creating too many datetime specific methods. However, I am not convinced about using .sel with 'time.year', it looks a bit hackish to me. Maybe all "CDO methods" can be integrated in one single "seltimes" method. Please look at the function below. The time_coord arguments lets you choose the time coordinate that you want to filter, and by using numpy.logical_and is it possible to do the whole operation in one single function call. It could be turned into a method. What do you think? ``` python %matplotlib inline import xray import numpy as np from matplotlib import pyplot as plt ifile = "HadCRUT.4.3.0.0.median.nc" ixd = xray.open_dataset(ifile) ``` You can download the example file from here http://www.metoffice.gov.uk/hadobs/hadcrut4/data/4.3.0.0/gridded_fields/HadCRUT.4.3.0.0.median_netcdf.zip Now comes the function. ``` python def seltime(ixd, time_coord, **kwargs): """ Select time steps by groups of years, months, etc.
``` It works, and it looks fast enough.
``` 1000 loops, best of 3: 1.05 ms per loop
``` If we average in time we can see the warm tonge in the pacific.
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
CDO-like convenience methods to select times 104484316 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issue_comments] ( [html_url] TEXT, [issue_url] TEXT, [id] INTEGER PRIMARY KEY, [node_id] TEXT, [user] INTEGER REFERENCES [users]([id]), [created_at] TEXT, [updated_at] TEXT, [author_association] TEXT, [body] TEXT, [reactions] TEXT, [performed_via_github_app] TEXT, [issue] INTEGER REFERENCES [issues]([id]) ); CREATE INDEX [idx_issue_comments_issue] ON [issue_comments] ([issue]); CREATE INDEX [idx_issue_comments_user] ON [issue_comments] ([user]);
user 1