home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where issue = 128528319 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 3

  • shoyer 2
  • wilhelmsen 1
  • jhamman 1

author_association 2

  • MEMBER 3
  • NONE 1

issue 1

  • All dimmensions become coordinates? · 4 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
269566818 https://github.com/pydata/xarray/issues/722#issuecomment-269566818 https://api.github.com/repos/pydata/xarray/issues/722 MDEyOklzc3VlQ29tbWVudDI2OTU2NjgxOA== jhamman 2443309 2016-12-29T01:12:16Z 2016-12-29T01:12:16Z MEMBER

I'm closing since #1017 has moved us past this question.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  All dimmensions become coordinates? 128528319
177036258 https://github.com/pydata/xarray/issues/722#issuecomment-177036258 https://api.github.com/repos/pydata/xarray/issues/722 MDEyOklzc3VlQ29tbWVudDE3NzAzNjI1OA== shoyer 1217238 2016-01-30T01:06:16Z 2016-01-30T01:06:16Z MEMBER

Yes, xarray checks for "trivial indexes" that are equivalent to what it would create automatically when it writes a file to disk: https://github.com/pydata/xarray/blob/v0.7.0/xarray/backends/common.py#L31-L47

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  All dimmensions become coordinates? 128528319
176884522 https://github.com/pydata/xarray/issues/722#issuecomment-176884522 https://api.github.com/repos/pydata/xarray/issues/722 MDEyOklzc3VlQ29tbWVudDE3Njg4NDUyMg== wilhelmsen 242610 2016-01-29T17:48:15Z 2016-01-29T17:48:15Z NONE

Thank you!

I was just wondering how you know then, which one is an "actual" coordinate and which one is an indexed ("default") coordinate?

xarray seem to know this.

Example:

``` In [1]: import xray as xr

In [2]: import numpy as np

In [3]: var1 = xr.DataArray(np.array([1, 2], np.float64), coords=[np.array([1, 2], np.int64)], dims=["coor1",], name = "var1")

In [4]: var2 = xr.DataArray(np.array([3, 4], np.float64), dims=["dim1",], name = "var2")

In [5]: ds.var1 Out[5]: <xray.DataArray 'var1' (coor1: 2)> array([ 1., 2.]) Coordinates: * coor1 (coor1) int64 1 2

In [6]: ds.var2 Out[6]: <xray.DataArray 'var2' (dim1: 2)> array([ 3., 4.]) Coordinates: * dim1 (dim1) int64 0 1

In [7]: ds.var1.coords Out[7]: Coordinates: * coor1 (coor1) int64 1 2

In [8]: ds.var2.coords Out[8]: Coordinates: * dim1 (dim1) int64 0 1

In [9]: ds.to_netcdf("/tmp/from_xr.nc") ```

And then

``` $ ncdump /tmp/from_xr.nc netcdf from_xr { dimensions: coor1 = 2 ; dim1 = 2 ; variables: int64 coor1(coor1) ; double var1(coor1) ; double var2(dim1) ; data:

coor1 = 1, 2 ;

var1 = 1, 2 ;

var2 = 3, 4 ; } ```

As dim1 is not written in the file, xarray somehow knows?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  All dimmensions become coordinates? 128528319
174543016 https://github.com/pydata/xarray/issues/722#issuecomment-174543016 https://api.github.com/repos/pydata/xarray/issues/722 MDEyOklzc3VlQ29tbWVudDE3NDU0MzAxNg== shoyer 1217238 2016-01-25T15:26:38Z 2016-01-25T15:26:38Z MEMBER

This is definitely intended behavior: if you don't supply a coordinate to label points along a dimension, a default coordinate (equivalently to range(n)) is created for you. This is somewhat similar to pandas. Looking through the docs, though, it looks like we never state this explicitly...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  All dimmensions become coordinates? 128528319

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 1117.075ms · About: xarray-datasette