home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 179052741 and user = 4160723 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • benbovy · 5 ✖

issue 1

  • WIP: Optional indexes (no more default coordinates given by range(n)) · 5 ✖

author_association 1

  • MEMBER 5
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
265987531 https://github.com/pydata/xarray/pull/1017#issuecomment-265987531 https://api.github.com/repos/pydata/xarray/issues/1017 MDEyOklzc3VlQ29tbWVudDI2NTk4NzUzMQ== benbovy 4160723 2016-12-09T10:57:06Z 2016-12-09T10:57:06Z MEMBER

The only concern I have for the repr changes is using the symbol * for missing coordinates. To me * really means that it is an index. Maybe just remove it? e.g.,

Coordinates: * y (y) |S1 'a' 'b' 'c' * x (x) int64 1 2 3 4 5 z (z) -

or use another symbol like o that means 'no index'?

Coordinates: * y (y) |S1 'a' 'b' 'c' * x (x) int64 1 2 3 4 5 o z (z) -

and/or even remove the coordinate name (because there is no coordinate)

Coordinates: * y (y) |S1 'a' 'b' 'c' * x (x) int64 1 2 3 4 5 o (z) -

Coordinates: * y (y) |S1 'a' 'b' 'c' * x (x) int64 1 2 3 4 5 (z) -

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  WIP: Optional indexes (no more default coordinates given by range(n)) 179052741
260789194 https://github.com/pydata/xarray/pull/1017#issuecomment-260789194 https://api.github.com/repos/pydata/xarray/issues/1017 MDEyOklzc3VlQ29tbWVudDI2MDc4OTE5NA== benbovy 4160723 2016-11-15T22:21:58Z 2016-11-15T22:21:58Z MEMBER

I also understand (1), but renaming Coordinates to Dimensions would be a bit odd too, especially in case multiple coordinates for a given dimension or multi-dimensional coordinates.

Another suggestion may be to "highlight" in the top list the dimensions which have an index, using the same symbol than in the coordinate list:

<xarray.DataArray (*x: 5, *y: 3, z: 7)> dask.array<xarray-..., shape=(5, 3, 7), dtype=float64, chunksize=(5, 3, 7)> Coordinates: * y (y) |S1 'a' 'b' 'c' * x (x) int64 1 2 3 4 5

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  WIP: Optional indexes (no more default coordinates given by range(n)) 179052741
255052837 https://github.com/pydata/xarray/pull/1017#issuecomment-255052837 https://api.github.com/repos/pydata/xarray/issues/1017 MDEyOklzc3VlQ29tbWVudDI1NTA1MjgzNw== benbovy 4160723 2016-10-20T09:15:34Z 2016-10-20T09:15:34Z MEMBER

+1 for the align error.

Yes. But, in that case you need a way to do the "fill with NAN" option without having to jump through too many hoops. How would you do that?

Using .set_index() (#1028) before .reindex_like() seems fine in that case. It's not much longer and it's more explicit.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  WIP: Optional indexes (no more default coordinates given by range(n)) 179052741
253791634 https://github.com/pydata/xarray/pull/1017#issuecomment-253791634 https://api.github.com/repos/pydata/xarray/issues/1017 MDEyOklzc3VlQ29tbWVudDI1Mzc5MTYzNA== benbovy 4160723 2016-10-14T12:55:21Z 2016-10-14T12:56:13Z MEMBER

Oops, I missed .diff() that already solves my given example. Anyway, I can vaguely see other cases (e.g., map algebra) where we want to compare or combine image or raster subsets (i.e., after some indexing) that have the same shape but that don't overlap or that come from sources with different sizes. That can be an issue if we create dummy coordinates when indexing, though reset_index() would help and would certainly be enough here.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  WIP: Optional indexes (no more default coordinates given by range(n)) 179052741
253681755 https://github.com/pydata/xarray/pull/1017#issuecomment-253681755 https://api.github.com/repos/pydata/xarray/issues/1017 MDEyOklzc3VlQ29tbWVudDI1MzY4MTc1NQ== benbovy 4160723 2016-10-14T00:58:46Z 2016-10-14T01:01:07Z MEMBER

Should we create dummy/virtual coordinates like range(n) on demand when indexing a dimension without labels?

I think about some possible use cases where this behavior - if I understand it well - may not be desired. For example, if we want to compute partial derivatives by finite difference, using xarray would not give the expected result (as numpy does):

``` python

z = np.random.rand(5, 5) dz_dx_numpy = z[1:, :] - z[:-1, :] # forward difference dz_dx_numpy array([[-0.16122906, -0.73841927, 0.11565084, 0.94529388, 0.04245993], [ 0.21066572, 0.11964058, -0.11203992, -0.52073269, -0.50827324], [-0.42100012, 0.39873985, 0.07957889, -0.02071456, 0.59944732], [-0.53819024, -0.29738881, 0.35238292, 0.01903809, 0.15671588]])

da = xr.DataArray(z, dims=('x', 'y'), name='z') dz_dx_xarray = da[1:, :] - da[:-1, :] # forward difference dz_dx_xarray <xarray.DataArray 'z' (x: 3, y: 5)> array([[ 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0.]]) Coordinates: * x (x) int64 1 2 3 ```

However, I guess that this specific kind of problem should rather be addressed using the upcoming logic for applying vectorized functions to xarray objects (#964).

e.g., array.coords['x'] would return a DataArray with values range(n) (importantly, this would not change the original array).

That sounds a bit weird to me (I'm not sure to understand, actually). What are the reasons/benefits of returning a DataArray instead of raising a KeyError?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  WIP: Optional indexes (no more default coordinates given by range(n)) 179052741

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