home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where user = 10563614 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

issue 5

  • to_dataframe/to_series fails when one out of more than one dims are stacked / multiindex 1
  • to_dataframe: no valid index for a 0-dimensional object 1
  • combine_by_coords could use allclose instead of equal to compare coordinates 1
  • Alignment with tolerance2 1
  • xarray allows several types for netcdf attributes. Is it expected ? 1

user 1

  • ghislainp · 5 ✖

author_association 1

  • CONTRIBUTOR 5
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1264596449 https://github.com/pydata/xarray/issues/7093#issuecomment-1264596449 https://api.github.com/repos/pydata/xarray/issues/7093 IC_kwDOAMm_X85LYDXh ghislainp 10563614 2022-10-02T09:37:47Z 2022-10-02T09:37:47Z CONTRIBUTOR
  • this issue was submitted because of https://github.com/pydata/xarray/pull/7085#discussion_r981443796
  • I also tend to agree that this behavior is fine for the non-specific netcdf attributes.
  • For specific attributes as unit and _FillValue, is it also fine ? I would expect that Dataset.to_netcdf check the type (string for unit and the type of the variable for _FillValue and raise at least a warning. It is currently possible to save a number for the unit... Is the resulting netcdf CF-compliant ?
  • if any kind of types for attributes is allowed, this requires to chase bugs of the kind solved in #7085.
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xarray allows several types for netcdf attributes. Is it expected ? 1388326248
831811778 https://github.com/pydata/xarray/pull/4489#issuecomment-831811778 https://api.github.com/repos/pydata/xarray/issues/4489 MDEyOklzc3VlQ29tbWVudDgzMTgxMTc3OA== ghislainp 10563614 2021-05-04T09:37:50Z 2021-05-04T09:37:50Z CONTRIBUTOR

yes, no problem, take your time. This is still a wanted feature in any case, I've recently needed it again. I've found a solution by converting the real index to integer after adequate scaling, but an integrated solution would be much better.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Alignment with tolerance2 715168959
699548837 https://github.com/pydata/xarray/issues/4465#issuecomment-699548837 https://api.github.com/repos/pydata/xarray/issues/4465 MDEyOklzc3VlQ29tbWVudDY5OTU0ODgzNw== ghislainp 10563614 2020-09-26T21:15:44Z 2020-09-26T21:15:44Z CONTRIBUTOR

Interesting discussion #2217. As far as I understand, it solves a wider problem than using a tolerance on and a member by member comparison... but more complex to implement.

Here is the simple solution that works for me (combine.py:70):

        if not (all(index.equals(indexes[0]) for index in indexes[1:])
                or (tolerance > 0 and \
                    all(index.is_numeric() for index in indexes) and \
                    all(np.allclose(index, indexes[0], atol=tolerance, rtol=0) for index in indexes[1:]))):

I've not tested in depth, I can make a PR, tests, doc if you agree with this solution.

Regarding the name of the arg. "tolerance" is nice, but allclose has atol and rtol. My solution above only set atol, but both may be useful. Should we use: 2args: atol, rtol 2 args: atolerance, rtolerance 1 args: tolerance could be a number (->atol) or a tuple interpreted as atol, rtol = tolerance or a dict .... ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  combine_by_coords could use allclose instead of equal to compare coordinates 709503596
695834632 https://github.com/pydata/xarray/issues/3008#issuecomment-695834632 https://api.github.com/repos/pydata/xarray/issues/3008 MDEyOklzc3VlQ29tbWVudDY5NTgzNDYzMg== ghislainp 10563614 2020-09-20T20:49:27Z 2020-09-20T20:49:27Z CONTRIBUTOR

The proposed PR completely rewrite how the Cartesian product is computed, MultiIndex.from_product is unable to deal with MultiIndex which was written for any iterables.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  to_dataframe/to_series fails when one out of more than one dims are stacked / multiindex 454106835
658912550 https://github.com/pydata/xarray/issues/4228#issuecomment-658912550 https://api.github.com/repos/pydata/xarray/issues/4228 MDEyOklzc3VlQ29tbWVudDY1ODkxMjU1MA== ghislainp 10563614 2020-07-15T17:54:57Z 2020-07-15T18:29:20Z CONTRIBUTOR

thanks for the very clear response. The behaviro make sense.

In fact, I should have explained what I'm trying to achieve, as this is kind of "take". I've a dict like this: python {'label1' : dict(coord1=1, coord2=4), 'label2' : dict(coord1=5, coord2=6), 'label3' : dict(coord1=4, coord2=2), } and I want to build an xarray (and then a dataframe) with coord1 and coord2 replaced by a new dims with values 'label1', 'label2', 'label3'.

I've done that by iterating over the dict, selecting with sel using the dict values, convert to dataframe and then concat the dataframes. pd.concat([x.sel(**d[k]).to_dataframe() or k in d]

A better option would be to do this "sel" or "take" with xarray only. Do you have an idea how to do it with existing xarray methods?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  to_dataframe: no valid index for a 0-dimensional object 657466413

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