home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 314239017 and user = 1217238 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

  • shoyer · 5 ✖

issue 1

  • Documentation on assign a value and vectorized indexing · 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
385011095 https://github.com/pydata/xarray/issues/2055#issuecomment-385011095 https://api.github.com/repos/pydata/xarray/issues/2055 MDEyOklzc3VlQ29tbWVudDM4NTAxMTA5NQ== shoyer 1217238 2018-04-27T15:46:01Z 2018-04-27T15:46:01Z MEMBER

Actually, on further consideration it is probably best to organize the narrative documentation by task/goal (user need), rather than xarray's internal organization of methods (the API docs are for this). So integrating this in the section on "Assigning values with indexing" makes sense for both of these.

Feel free to reorganize the existing material. I think showing how to assign with .loc is more important than combined indexing with in-place arithmetic, for example.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Documentation on assign a value and vectorized indexing 314239017
385009416 https://github.com/pydata/xarray/issues/2055#issuecomment-385009416 https://api.github.com/repos/pydata/xarray/issues/2055 MDEyOklzc3VlQ29tbWVudDM4NTAwOTQxNg== shoyer 1217238 2018-04-27T15:41:34Z 2018-04-27T15:41:34Z MEMBER

@chiaral Yes, I think that would be a good place to add the example of assigning with .loc.

The where example might be better added to the section on where: http://xarray.pydata.org/en/v0.10.3/indexing.html#masking-with-where

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Documentation on assign a value and vectorized indexing 314239017
382482737 https://github.com/pydata/xarray/issues/2055#issuecomment-382482737 https://api.github.com/repos/pydata/xarray/issues/2055 MDEyOklzc3VlQ29tbWVudDM4MjQ4MjczNw== shoyer 1217238 2018-04-18T18:23:21Z 2018-04-18T18:23:21Z MEMBER

This just came up again on StackOverflow: https://stackoverflow.com/questions/49905351/assigning-particular-elements-of-dataarray-based-on-another/49906534#49906534

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Documentation on assign a value and vectorized indexing 314239017
381267240 https://github.com/pydata/xarray/issues/2055#issuecomment-381267240 https://api.github.com/repos/pydata/xarray/issues/2055 MDEyOklzc3VlQ29tbWVudDM4MTI2NzI0MA== shoyer 1217238 2018-04-13T21:39:47Z 2018-04-13T21:39:47Z MEMBER

because selecting and assigning are discussed together. I think that should be fixed too.

Agreed, it is confusingly worded. I missed that when I reread it earlier.

If you're interested in tackling any of these issues, pull requests would be gratefully accepted! See here for guidelines: http://xarray.pydata.org/en/stable/contributing.html#contributing-to-the-documentation

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Documentation on assign a value and vectorized indexing 314239017
381252806 https://github.com/pydata/xarray/issues/2055#issuecomment-381252806 https://api.github.com/repos/pydata/xarray/issues/2055 MDEyOklzc3VlQ29tbWVudDM4MTI1MjgwNg== shoyer 1217238 2018-04-13T20:30:43Z 2018-04-13T20:30:43Z MEMBER

A) I am not sure if it is possible, but maybe add a proper error to such thing - try to assign values when using any of the indexing methods - would be great.

Yes, totally agreed that this would be ideal, but unfortunately I don't think this is possible. Pandas attempted something with its SettingWithCopy warnings, but in most cases I think those just add noise and warm about something that isn't actually a problem.

B) if A is not possible, maybe in the DataArray page you should repeat the Warning.

I don't know if it makes sense on the overview page for DataArray, but we should definitely repeat it on the doc page for DataArray.sel: http://xarray.pydata.org/en/stable/generated/xarray.DataArray.sel.html

C) you should add to the text of the Warning to use vectorized indexing, so people know how to fix the issue.

Yes, agreed!

D) Also for the vectorized indexing page, an example using .sel could help. For example, something like the following, which I think it should work (using your same dataArray within the vectorized indexing help)

Yes, I think we should add an example of using vectorized indexing for assignment.

We already have some examples of using it with .sel() further down the page, but I agree that label-based indexing should probably be more strongly emphasized: http://xarray.pydata.org/en/stable/indexing.html#more-advanced-indexing

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Documentation on assign a value and vectorized indexing 314239017

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