home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 834273555 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 5

  • Jeitan 2
  • shoyer 1
  • dcherian 1
  • max-sixty 1
  • andersy005 1

author_association 2

  • MEMBER 4
  • NONE 2

issue 1

  • Ability to rename items inside a coordinate, matching pandas rename() functionality · 6 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1101516883 https://github.com/pydata/xarray/issues/5048#issuecomment-1101516883 https://api.github.com/repos/pydata/xarray/issues/5048 IC_kwDOAMm_X85Bp9BT dcherian 2448579 2022-04-18T15:52:30Z 2022-04-18T15:52:30Z MEMBER

Closing in favour of #6377

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Ability to rename items inside a coordinate, matching pandas rename() functionality 834273555
804363539 https://github.com/pydata/xarray/issues/5048#issuecomment-804363539 https://api.github.com/repos/pydata/xarray/issues/5048 MDEyOklzc3VlQ29tbWVudDgwNDM2MzUzOQ== shoyer 1217238 2021-03-22T20:14:47Z 2021-03-22T20:14:47Z MEMBER

NumPy has "select" and "choose" for this, but I don't really love either of those APIs, either.

Maybe replace_in_data or update_data would be appropriate names for a DataArray method that uses a dictionary as an argument? Then updating a coordinate would be solved with something like: e.g., python da['two'] = da['two'].replace_in_data({'dd': 'd'})

{
    "total_count": 3,
    "+1": 3,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Ability to rename items inside a coordinate, matching pandas rename() functionality 834273555
804297243 https://github.com/pydata/xarray/issues/5048#issuecomment-804297243 https://api.github.com/repos/pydata/xarray/issues/5048 MDEyOklzc3VlQ29tbWVudDgwNDI5NzI0Mw== Jeitan 9399446 2021-03-22T18:32:55Z 2021-03-22T18:32:55Z NONE

@andersy005 's method definitely works, and I can iterate to do it for multiple names, so I've already gone away happy. A dedicated method would be nice though :).

"rename" is understandably overloaded ... would something like "update_coords" be workable? It sort of matches the existing "assign_coords".

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Ability to rename items inside a coordinate, matching pandas rename() functionality 834273555
801627246 https://github.com/pydata/xarray/issues/5048#issuecomment-801627246 https://api.github.com/repos/pydata/xarray/issues/5048 MDEyOklzc3VlQ29tbWVudDgwMTYyNzI0Ng== max-sixty 5635139 2021-03-18T05:02:10Z 2021-03-18T05:02:10Z MEMBER

Agree with @andersy005 's suggestion (and it takes a lambda fwiw)

Though I also find myself reaching for a method like pandas' rename occasionally.

Aside from the rename name, which I think is not good, what do others think about a method that takes a mapping and replaces values?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Ability to rename items inside a coordinate, matching pandas rename() functionality 834273555
801530191 https://github.com/pydata/xarray/issues/5048#issuecomment-801530191 https://api.github.com/repos/pydata/xarray/issues/5048 MDEyOklzc3VlQ29tbWVudDgwMTUzMDE5MQ== Jeitan 9399446 2021-03-18T00:35:13Z 2021-03-18T00:50:12Z NONE

I have not ... that does work! Do you have a nice way to do that for a whole set? I only used one here, but I'm typically renaming something like 5-8 at a time, so "rdict" would be much bigger.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Ability to rename items inside a coordinate, matching pandas rename() functionality 834273555
801528450 https://github.com/pydata/xarray/issues/5048#issuecomment-801528450 https://api.github.com/repos/pydata/xarray/issues/5048 MDEyOklzc3VlQ29tbWVudDgwMTUyODQ1MA== andersy005 13301940 2021-03-18T00:30:24Z 2021-03-18T00:30:24Z MEMBER

@Jeitan, have you looked into where() yet?

```python In [16]: da['two'] = da.two.where(da.two != 'dd', 'd')

In [17]: da Out[17]: <xarray.DataArray (one: 3, two: 5)> array([[-0.01774725, 0.42453644, -0.80758257, 0.18659729, -1.14712204], [ 2.06813654, 1.32605605, -1.49284031, 0.5929485 , -2.29315181], [ 0.30243348, 0.05863335, 2.09869485, 1.79054292, -0.99844954]]) Coordinates: * one (one) int64 1 2 3 * two (two) <U2 'a' 'b' 'c' 'd' 'e' ```

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Ability to rename items inside a coordinate, matching pandas rename() functionality 834273555

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