home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 657466413 and user = 2448579 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 1

  • dcherian · 3 ✖

issue 1

  • to_dataframe: no valid index for a 0-dimensional object · 3 ✖

author_association 1

  • MEMBER 3
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
715987107 https://github.com/pydata/xarray/issues/4228#issuecomment-715987107 https://api.github.com/repos/pydata/xarray/issues/4228 MDEyOklzc3VlQ29tbWVudDcxNTk4NzEwNw== dcherian 2448579 2020-10-24T16:47:34Z 2020-10-24T16:47:34Z MEMBER

f that's good enough to open a pull request and ask for a review.

please go ahead and open a PR. Thanks.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  to_dataframe: no valid index for a 0-dimensional object 657466413
658932130 https://github.com/pydata/xarray/issues/4228#issuecomment-658932130 https://api.github.com/repos/pydata/xarray/issues/4228 MDEyOklzc3VlQ29tbWVudDY1ODkzMjEzMA== dcherian 2448579 2020-07-15T18:32:36Z 2020-07-15T18:32:36Z MEMBER

You could do it with "advanced indexing" by providing a dataarray to the .sel or .isel methods: https://xarray.pydata.org/en/stable/indexing.html#more-advanced-indexing

``` python da = xr.DataArray([[1, 2, 3], [4,5,6]], dims=["coord1", "coord2"], coords={"coord2": [10, 20, 30], "coord1": [1,2]})

i1 = xr.DataArray([1, 0], dims=["z"], coords={"z": ["label1", "label2"]}) i2 = xr.DataArray([2, 1], dims=["z"], coords={"z": ["label1", "label2"]})

da.isel(coord1=i1, coord2=i2, drop=True).to_dataframe(name="asd") ```

asd z label1 6 label2 2

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  to_dataframe: no valid index for a 0-dimensional object 657466413
658884817 https://github.com/pydata/xarray/issues/4228#issuecomment-658884817 https://api.github.com/repos/pydata/xarray/issues/4228 MDEyOklzc3VlQ29tbWVudDY1ODg4NDgxNw== dcherian 2448579 2020-07-15T17:02:14Z 2020-07-15T17:02:14Z MEMBER

You need xr.DataArray([1], coords=[('onecoord', [2])]).sel(onecoord=[2]).to_dataframe(name='name')

The difference is using onecoord=2 gives a scalar ```

xr.DataArray([1], coords=[('onecoord', [2])]).sel(onecoord=2) <xarray.DataArray ()> array(1) Coordinates: onecoord int64 2 ```

while using onecoord=[2] gives a 1 element vector ```

xr.DataArray([1], coords=[('onecoord', [2])]).sel(onecoord=[2]) <xarray.DataArray (onecoord: 1)> array([1]) Coordinates: * onecoord (onecoord) int64 2 ```

And to_dataframe cannot handle scalars.

I am not sure that there is a sensible way to convert a scalar DataArray to a DataFrame but we should throw a more informative error in any case.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  to_dataframe: no valid index for a 0-dimensional object 657466413

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

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]);
Powered by Datasette · Queries took 147.216ms · About: xarray-datasette