issue_comments
8 rows where issue = 365438396 and user = 6628425 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
issue 1
- da.loc[date[0]] brings up two instead of one · 8 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
426398519 | https://github.com/pydata/xarray/issues/2450#issuecomment-426398519 | https://api.github.com/repos/pydata/xarray/issues/2450 | MDEyOklzc3VlQ29tbWVudDQyNjM5ODUxOQ== | spencerkclark 6628425 | 2018-10-02T19:21:45Z | 2018-10-02T19:21:45Z | MEMBER | This seems like an xarray version issue; the |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
da.loc[date[0]] brings up two instead of one 365438396 | |
426392397 | https://github.com/pydata/xarray/issues/2450#issuecomment-426392397 | https://api.github.com/repos/pydata/xarray/issues/2450 | MDEyOklzc3VlQ29tbWVudDQyNjM5MjM5Nw== | spencerkclark 6628425 | 2018-10-02T19:01:16Z | 2018-10-02T19:01:16Z | MEMBER |
👍 let me know how it goes. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
da.loc[date[0]] brings up two instead of one 365438396 | |
426381265 | https://github.com/pydata/xarray/issues/2450#issuecomment-426381265 | https://api.github.com/repos/pydata/xarray/issues/2450 | MDEyOklzc3VlQ29tbWVudDQyNjM4MTI2NQ== | spencerkclark 6628425 | 2018-10-02T18:27:17Z | 2018-10-02T18:27:17Z | MEMBER | Does |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
da.loc[date[0]] brings up two instead of one 365438396 | |
426374411 | https://github.com/pydata/xarray/issues/2450#issuecomment-426374411 | https://api.github.com/repos/pydata/xarray/issues/2450 | MDEyOklzc3VlQ29tbWVudDQyNjM3NDQxMQ== | spencerkclark 6628425 | 2018-10-02T18:07:16Z | 2018-10-02T18:07:16Z | MEMBER | @am-thyst could you show all the code that you used to try it out? If I run all the lines (from 1-8 in https://github.com/pydata/xarray/issues/2450#issuecomment-426340226 and https://github.com/pydata/xarray/issues/2450#issuecomment-426353764) in my IPython console things work for me. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
da.loc[date[0]] brings up two instead of one 365438396 | |
426353764 | https://github.com/pydata/xarray/issues/2450#issuecomment-426353764 | https://api.github.com/repos/pydata/xarray/issues/2450 | MDEyOklzc3VlQ29tbWVudDQyNjM1Mzc2NA== | spencerkclark 6628425 | 2018-10-02T17:07:37Z | 2018-10-02T17:07:37Z | MEMBER | @am-thyst thanks for the extra details -- try out my method -- I think it does the same thing. Well perhaps you'll just need to multiply the result by 100 at the end and use Your approach can also be vectorized in such a way that you don't need to manually iterate over the individual times: ``` In [6]: b = da.where(da >= threshold, other=0) In [7]: c = b.where(b == 0, other=1) In [8]: (c.sum('time') / c.sizes['time']) * 100
Out[8]:
<xarray.DataArray (x: 2, y: 3)>
array([[ 25., 50., 25.],
[ 25., 50., 50.]])
Dimensions without coordinates: x, y
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
da.loc[date[0]] brings up two instead of one 365438396 | |
426340226 | https://github.com/pydata/xarray/issues/2450#issuecomment-426340226 | https://api.github.com/repos/pydata/xarray/issues/2450 | MDEyOklzc3VlQ29tbWVudDQyNjM0MDIyNg== | spencerkclark 6628425 | 2018-10-02T16:28:42Z | 2018-10-02T16:28:42Z | MEMBER | I'm not sure if I'm understanding the calculation correctly; is something like the following what you are looking for? ``` In [1]: import numpy as np; import pandas as pd; import xarray as xr In [2]: times = pd.date_range('1979', periods=4, freq='12H') In [3]: da = xr.DataArray(np.random.rand(4, 2, 3), coords={'time': times}, dims=['time', 'x', 'y']) In [4]: threshold = 0.5 In [5]: (da > threshold).mean('time') Out[5]: <xarray.DataArray (x: 2, y: 3)> array([[ 0.25, 0.5 , 0.25], [ 0.25, 0.5 , 0.5 ]]) Dimensions without coordinates: x, y ``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
da.loc[date[0]] brings up two instead of one 365438396 | |
426317958 | https://github.com/pydata/xarray/issues/2450#issuecomment-426317958 | https://api.github.com/repos/pydata/xarray/issues/2450 | MDEyOklzc3VlQ29tbWVudDQyNjMxNzk1OA== | spencerkclark 6628425 | 2018-10-02T15:27:59Z | 2018-10-02T15:36:28Z | MEMBER | @am-thyst could you provide more details on what sort of operation you are trying to do with each time slice? Typically this kind of process can be better handled in a vectorized way (i.e. without manually iterating over the times). |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
da.loc[date[0]] brings up two instead of one 365438396 | |
426250976 | https://github.com/pydata/xarray/issues/2450#issuecomment-426250976 | https://api.github.com/repos/pydata/xarray/issues/2450 | MDEyOklzc3VlQ29tbWVudDQyNjI1MDk3Ng== | spencerkclark 6628425 | 2018-10-02T12:16:03Z | 2018-10-02T12:16:03Z | MEMBER | Thanks @am-thyst, this happens to be expected behavior. For a dimension indexed by a DatetimeIndex (e.g. your As you inferred, if you add detail to the string you provide, you can refine the selection. That said, you need to be careful of the format you use (I think the reason you get a In [2]: times = pd.date_range('1979', periods=8, freq='12H') In [3]: da = xr.DataArray(np.arange(8), coords=[times], dims=['time']) In [4]: da Out[4]: <xarray.DataArray (time: 8)> array([0, 1, 2, 3, 4, 5, 6, 7]) Coordinates: * time (time) datetime64[ns] 1979-01-01 ... 1979-01-04T12:00:00 In [5]: da.loc['1979-01-01T00']
Out[5]:
<xarray.DataArray ()>
array(0)
Coordinates:
time datetime64[ns] 1979-01-01
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
da.loc[date[0]] brings up two instead of one 365438396 |
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