issue_comments
5 rows where issue = 596606599 and user = 30388627 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: reactions, created_at (date), updated_at (date)
issue 1
- Sort DataArray by data values along one dim · 5 ✖
| id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 707744782 | https://github.com/pydata/xarray/issues/3957#issuecomment-707744782 | https://api.github.com/repos/pydata/xarray/issues/3957 | MDEyOklzc3VlQ29tbWVudDcwNzc0NDc4Mg== | zxdawn 30388627 | 2020-10-13T13:38:34Z | 2020-10-13T13:38:34Z | NONE | @JavierRuano I find the simpler solution from a similar question in stack overflow.
Complete example``` import xarray as xr import numpy as np x = 4 y = 2 z = 4 data = np.arange(xyz).reshape(z, y, x) 3d array with coordscld_1 = xr.DataArray(data, dims=['z', 'y', 'x'], coords={'z': np.arange(z)}) 2d array without coordscld_2 = xr.DataArray(np.arange(xy).reshape(y, x)1.5+1, dims=['y', 'x']) expand 2d to 3dcld_2 = cld_2.expand_dims(z=[4]) concatcld = xr.concat([cld_1, cld_2], dim='z') paired arraypair = cld.copy(data=np.arange(xy(z+1)).reshape(z+1, y, x)) sort_pair = np.take_along_axis(pair.values, cld.argsort(axis=0), axis=0) print(cld) print(pair) print(sort_pair) ``` Output: ``` <xarray.DataArray (z: 5, y: 2, x: 4)> array([[[ 0. , 1. , 2. , 3. ], [ 4. , 5. , 6. , 7. ]],
Coordinates: * z (z) int64 0 1 2 3 4 Dimensions without coordinates: y, x <xarray.DataArray (z: 5, y: 2, x: 4)> array([[[ 0, 1, 2, 3], [ 4, 5, 6, 7]],
Coordinates: * z (z) int64 0 1 2 3 4 Dimensions without coordinates: y, x [[[ 0 1 2 3] [ 4 5 6 7]] [[32 33 34 35] [36 37 38 39]] [[ 8 9 10 11] [12 13 14 15]] [[16 17 18 19] [20 21 22 23]] [[24 25 26 27] ``` Note, I have to use
|
{
"total_count": 1,
"+1": 1,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
Sort DataArray by data values along one dim 596606599 | |
| 611483929 | https://github.com/pydata/xarray/issues/3957#issuecomment-611483929 | https://api.github.com/repos/pydata/xarray/issues/3957 | MDEyOklzc3VlQ29tbWVudDYxMTQ4MzkyOQ== | zxdawn 30388627 | 2020-04-09T11:43:51Z | 2020-04-09T11:43:51Z | NONE | I need to use |
{
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
Sort DataArray by data values along one dim 596606599 | |
| 611348892 | https://github.com/pydata/xarray/issues/3957#issuecomment-611348892 | https://api.github.com/repos/pydata/xarray/issues/3957 | MDEyOklzc3VlQ29tbWVudDYxMTM0ODg5Mg== | zxdawn 30388627 | 2020-04-09T06:13:07Z | 2020-04-09T06:13:07Z | NONE | @JavierRuano When the |
{
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
Sort DataArray by data values along one dim 596606599 | |
| 611299453 | https://github.com/pydata/xarray/issues/3957#issuecomment-611299453 | https://api.github.com/repos/pydata/xarray/issues/3957 | MDEyOklzc3VlQ29tbWVudDYxMTI5OTQ1Mw== | zxdawn 30388627 | 2020-04-09T02:54:30Z | 2020-04-09T02:54:30Z | NONE | @JavierRuano Nice suggestion! I combine them to df = ds.to_dataframe() new_ds = df.sort_values(by='cld').to_xarray().transpose() ``` |
{
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
Sort DataArray by data values along one dim 596606599 | |
| 611291129 | https://github.com/pydata/xarray/issues/3957#issuecomment-611291129 | https://api.github.com/repos/pydata/xarray/issues/3957 | MDEyOklzc3VlQ29tbWVudDYxMTI5MTEyOQ== | zxdawn 30388627 | 2020-04-09T02:22:33Z | 2020-04-09T02:22:33Z | NONE | @JavierRuano Thank you very much. This example is a special case. If the order of |
{
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
Sort DataArray by data values along one dim 596606599 |
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