home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 366510937 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 2

  • max-sixty 2
  • dcherian 1

issue 1

  • Update docs to include how to Join using a non-index coord · 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
427615001 https://github.com/pydata/xarray/issues/2460#issuecomment-427615001 https://api.github.com/repos/pydata/xarray/issues/2460 MDEyOklzc3VlQ29tbWVudDQyNzYxNTAwMQ== max-sixty 5635139 2018-10-07T00:02:53Z 2018-10-08T19:32:18Z MEMBER

I'm writing something up for the docs. But I'm spinning once again. ~Did that example only work because the coords were ints that are being used as index positions?~ Edit: this approach works with a superset of labels, but not a subset

For example:

```python

In [48]: da = xr.DataArray(np.arange(4), dims=['y'], ...: coords={'y': list('abcd')})

In [49]: da Out[49]: <xarray.DataArray (y: 4)> array([0, 1, 2, 3]) Coordinates: * y (y) <U1 'a' 'b' 'c' 'd'

In [45]: da2 = xr.DataArray(np.arange(6), dims=['a'], coords=dict(y=(('a'),list('fedcba'))))

In [46]: da2 Out[46]: <xarray.DataArray (a: 6)> array([0, 1, 2, 3, 4, 5]) Coordinates: y (a) <U1 'f' 'e' 'd' 'c' 'b' 'a' Dimensions without coordinates: a

In [50]: da2.sel(a=da.y)

TypeError Traceback (most recent call last) <ipython-input-50-9514c3c27169> in <module> ----> 1 da2.sel(a=da.y)

/usr/local/lib/python3.7/site-packages/xarray/core/dataarray.py in sel(self, indexers, method, tolerance, drop, indexers_kwargs) 845 ds = self._to_temp_dataset().sel( 846 indexers=indexers, drop=drop, method=method, tolerance=tolerance, --> 847 indexers_kwargs) 848 return self._from_temp_dataset(ds) 849

/usr/local/lib/python3.7/site-packages/xarray/core/dataset.py in sel(self, indexers, method, tolerance, drop, **indexers_kwargs) 1620 pos_indexers, new_indexes = remap_label_indexers( 1621 self, indexers=indexers, method=method, tolerance=tolerance) -> 1622 result = self.isel(indexers=pos_indexers, drop=drop) 1623 return result._replace_indexes(new_indexes) 1624

/usr/local/lib/python3.7/site-packages/xarray/core/dataset.py in isel(self, indexers, drop, **indexers_kwargs) 1537 for name, var in iteritems(self._variables): 1538 var_indexers = {k: v for k, v in indexers_list if k in var.dims} -> 1539 new_var = var.isel(indexers=var_indexers) 1540 if not (drop and name in var_indexers): 1541 variables[name] = new_var

/usr/local/lib/python3.7/site-packages/xarray/core/variable.py in isel(self, indexers, drop, **indexers_kwargs) 905 if dim in indexers: 906 key[i] = indexers[dim] --> 907 return self[tuple(key)] 908 909 def squeeze(self, dim=None):

/usr/local/lib/python3.7/site-packages/xarray/core/variable.py in getitem(self, key) 614 array x.values directly. 615 """ --> 616 dims, indexer, new_order = self._broadcast_indexes(key) 617 data = as_indexable(self._data)[indexer] 618 if new_order:

/usr/local/lib/python3.7/site-packages/xarray/core/variable.py in _broadcast_indexes(self, key) 485 dims.append(d) 486 if len(set(dims)) == len(dims): --> 487 return self._broadcast_indexes_outer(key) 488 489 return self._broadcast_indexes_vectorized(key)

/usr/local/lib/python3.7/site-packages/xarray/core/variable.py in _broadcast_indexes_outer(self, key) 537 new_key.append(k) 538 --> 539 return dims, OuterIndexer(tuple(new_key)), None 540 541 def _nonzero(self):

/usr/local/lib/python3.7/site-packages/xarray/core/indexing.py in init(self, key) 376 if not np.issubdtype(k.dtype, np.integer): 377 raise TypeError('invalid indexer array, does not have ' --> 378 'integer dtype: {!r}'.format(k)) 379 if k.ndim != 1: 380 raise TypeError('invalid indexer array for {}, must have '

TypeError: invalid indexer array, does not have integer dtype: array(['a', 'b', 'c', 'd'], dtype='<U1') ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Update docs to include how to Join using a non-index coord 366510937
427550412 https://github.com/pydata/xarray/issues/2460#issuecomment-427550412 https://api.github.com/repos/pydata/xarray/issues/2460 MDEyOklzc3VlQ29tbWVudDQyNzU1MDQxMg== dcherian 2448579 2018-10-06T06:28:50Z 2018-10-06T06:28:50Z MEMBER

"add a section to the docs on how .sel can be specifically used for joins."

@max-sixty I think this would be great

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Update docs to include how to Join using a non-index coord 366510937
427522559 https://github.com/pydata/xarray/issues/2460#issuecomment-427522559 https://api.github.com/repos/pydata/xarray/issues/2460 MDEyOklzc3VlQ29tbWVudDQyNzUyMjU1OQ== max-sixty 5635139 2018-10-05T23:15:19Z 2018-10-05T23:15:19Z MEMBER

There's some advanced indexing that I didn't know about, as highlighted in the SO answer.

If anyone else has been confused on this, lmk and I'll add a section to the docs on how .sel can be specifically used for joins.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Update docs to include how to Join using a non-index coord 366510937

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