home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 675288247 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 3

  • dcherian 3
  • keewis 1
  • lamorton 1

author_association 2

  • MEMBER 4
  • NONE 1

issue 1

  • "_center" postfix on axis label resulting from groupby_bins persists after renaming variable · 5 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
735282792 https://github.com/pydata/xarray/issues/4322#issuecomment-735282792 https://api.github.com/repos/pydata/xarray/issues/4322 MDEyOklzc3VlQ29tbWVudDczNTI4Mjc5Mg== dcherian 2448579 2020-11-28T19:51:31Z 2020-11-28T19:51:31Z MEMBER

Yes I think something like this (though ugly) will be necessary.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  "_center" postfix on axis label resulting from groupby_bins persists after renaming variable 675288247
734488917 https://github.com/pydata/xarray/issues/4322#issuecomment-734488917 https://api.github.com/repos/pydata/xarray/issues/4322 MDEyOklzc3VlQ29tbWVudDczNDQ4ODkxNw== keewis 14808389 2020-11-26T21:51:03Z 2020-11-26T21:51:03Z MEMBER

if I understand correctly, this happens here: https://github.com/pydata/xarray/blob/5883a460b8fa9a72a2f12ee6495665bb7cc304f6/xarray/plot/plot.py#L295-L300

where xlabel and ylabel are extracted from xplt and yplt using label_from_attrs. In _resolve_intervals_1dplot xlabel and ylabel simply get the _center suffix, it is not used for anything else. Wouldn't it be possible to modify the calls of _infer_line_data and _resolve_intervals_1dplot to something like this: ```python xplt, yplt, hueplt, hue_label = _infer_line_data(darray, x, y, hue)

# Remove pd.Intervals if contained in xplt.values and/or yplt.values. 
xplt_val, yplt_val, x_suffix, y_suffix, kwargs = _resolve_intervals_1dplot( 
    xplt.values, yplt.values, kwargs 
)
xlabel = label_from_attrs(xplt, extra=x_suffix)
ylabel = label_from_attrs(yplt, extra=y_suffix)

`` and then have_resolve_intervals_1dplotreturn either"_center"or""asx_suffixandy_suffix`.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  "_center" postfix on axis label resulting from groupby_bins persists after renaming variable 675288247
670764550 https://github.com/pydata/xarray/issues/4322#issuecomment-670764550 https://api.github.com/repos/pydata/xarray/issues/4322 MDEyOklzc3VlQ29tbWVudDY3MDc2NDU1MA== dcherian 2448579 2020-08-07T22:28:27Z 2020-08-07T22:28:27Z MEMBER

Oh sorry I misunderstood that bit. Yes, that looks like a bug. A PR would be welcome. I guess you should add a suffix kwarg to the plot.utils.label_from_attrs function.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  "_center" postfix on axis label resulting from groupby_bins persists after renaming variable 675288247
670757610 https://github.com/pydata/xarray/issues/4322#issuecomment-670757610 https://api.github.com/repos/pydata/xarray/issues/4322 MDEyOklzc3VlQ29tbWVudDY3MDc1NzYxMA== lamorton 23484003 2020-08-07T22:23:24Z 2020-08-07T22:23:24Z NONE

@dcherian: OK, thanks, now I understand why it is happening -- there's no unambiguous way to represent the intervals as floats, so one needs to use either the left/right/midpoint & indicate that. For my case, I think I will just replace the array of intervals with the array of midpoints of the intervals.

The "_center" tag still doesn't work with the automatic units labeling though:

import xarray as xr import numpy as np data_vars={'y':('x',np.ones((101)),{'units':'kg/m'})} coords={'x':('x',np.linspace(0,1,101,endpoint=True),{'units':'m'})} ds = xr.Dataset(data_vars,coords) dsd = ds.groupby_bins('x',np.linspace(0,1,11,endpoint=True),right=False).sum(dim='x') dsd.x_bins.attrs = dsd.x_bins.attrs dsd.y.plot() #The x-axis label still looks like "x [m]_center"

The "_center" tag should be applied before the "[m]" one.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  "_center" postfix on axis label resulting from groupby_bins persists after renaming variable 675288247
670721702 https://github.com/pydata/xarray/issues/4322#issuecomment-670721702 https://api.github.com/repos/pydata/xarray/issues/4322 MDEyOklzc3VlQ29tbWVudDY3MDcyMTcwMg== dcherian 2448579 2020-08-07T21:32:53Z 2020-08-07T21:32:53Z MEMBER

This is because x_bins contains interval objects. .plot is calculating the center of the interval and letting you know that it is doing so.

If you want that line plot please use ax.set_xlabel, otheriwse try .plot.step which will more faithfully represent the intervals with label x_bins

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  "_center" postfix on axis label resulting from groupby_bins persists after renaming variable 675288247

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 206.001ms · About: xarray-datasette
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows