home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

9 rows where author_association = "MEMBER", issue = 143264649 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 · 9 ✖

issue 1

  • Multi-index indexing · 9 ✖

author_association 1

  • MEMBER · 9 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
233504589 https://github.com/pydata/xarray/pull/802#issuecomment-233504589 https://api.github.com/repos/pydata/xarray/issues/802 MDEyOklzc3VlQ29tbWVudDIzMzUwNDU4OQ== shoyer 1217238 2016-07-19T01:15:34Z 2016-07-19T01:15:34Z MEMBER

@tippetts Thanks for checking in. I actually hadn't noticed the last round of changes here, but I think this is good to go in now! Big thanks to @benbovy!!!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Multi-index indexing 143264649
225330535 https://github.com/pydata/xarray/pull/802#issuecomment-225330535 https://api.github.com/repos/pydata/xarray/issues/802 MDEyOklzc3VlQ29tbWVudDIyNTMzMDUzNQ== shoyer 1217238 2016-06-11T01:57:10Z 2016-06-11T01:57:10Z MEMBER

I did a little bit of testing. Here is one case I found where things don't work as I expected:

``` In [32]: idx = pd.MultiIndex.from_product([['a', 'b'], [0, 1, 2]], names=['lev0', 'lev1'])

In [33]: data = xr.DataArray(range(6), [('x', idx)])

In [34]: data.sel(x=('a',)) Out[34]: <xarray.DataArray (lev1: 3)> array([0, 1, 2]) Coordinates: * lev1 (lev1) int64 0 1 2

In [35]: data.sel(x='a') Out[35]: <xarray.DataArray (x: 3)> array([0, 1, 2]) Coordinates: * x (x) object ('a', 0) ('a', 1) ('a', 2) ```

I would expect an index drop in the last case, too. I guess we need to check for scalars.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Multi-index indexing 143264649
224347054 https://github.com/pydata/xarray/pull/802#issuecomment-224347054 https://api.github.com/repos/pydata/xarray/issues/802 MDEyOklzc3VlQ29tbWVudDIyNDM0NzA1NA== shoyer 1217238 2016-06-07T17:05:11Z 2016-06-07T17:05:11Z MEMBER

Just went through and gave another full review -- this is looking quite nice, just a few more things to clean up!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Multi-index indexing 143264649
224106148 https://github.com/pydata/xarray/pull/802#issuecomment-224106148 https://api.github.com/repos/pydata/xarray/issues/802 MDEyOklzc3VlQ29tbWVudDIyNDEwNjE0OA== shoyer 1217238 2016-06-06T22:18:28Z 2016-06-06T22:18:28Z MEMBER

I don't think we need to handle it -- I'm definitely supportive of only supporting unambiguous syntax. Let's just note the difference from pandas.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Multi-index indexing 143264649
224093911 https://github.com/pydata/xarray/pull/802#issuecomment-224093911 https://api.github.com/repos/pydata/xarray/issues/802 MDEyOklzc3VlQ29tbWVudDIyNDA5MzkxMQ== shoyer 1217238 2016-06-06T21:27:59Z 2016-06-06T21:27:59Z MEMBER

Yeah, that behavior looks pretty good to me -- there are limits on how flexible you can make things :).

We are fortunate that we have .sel, which lets us side-step some tricky ambiguous cases. Still, how do we handle data.loc['a', 0] if data is 2-dimensional? Pandas uses some terrible fall-back logic to allow the 0 to index either the second level or the second dimension, depending upon which works.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Multi-index indexing 143264649
224047760 https://github.com/pydata/xarray/pull/802#issuecomment-224047760 https://api.github.com/repos/pydata/xarray/issues/802 MDEyOklzc3VlQ29tbWVudDIyNDA0Nzc2MA== shoyer 1217238 2016-06-06T18:35:27Z 2016-06-06T18:35:27Z MEMBER

A possible remaining issue is that using a tuple of tuples, lists or slices exactly behaves like pandas (it calls get_locs) while a nested list can still be used to select couples of multi-index labels (it calls get_indexer). Should we allow only one of two behaviors, or keep both (and mention it in the docs)?

Can you give a quick example of what using the nested list look like?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Multi-index indexing 143264649
201378550 https://github.com/pydata/xarray/pull/802#issuecomment-201378550 https://api.github.com/repos/pydata/xarray/issues/802 MDEyOklzc3VlQ29tbWVudDIwMTM3ODU1MA== shoyer 1217238 2016-03-25T17:30:33Z 2016-03-25T17:30:33Z MEMBER

Dictionaries not hashable, so we might be able to detect this case by calling hash() and raising a KeyError with alternative suggestions. Just an idea -- not sure if there's a clean way to implement that.

On Fri, Mar 25, 2016 at 10:10 AM, Benoit Bovy notifications@github.com wrote:

After refactoring a bit, da.loc[{'band': 'foo'}, :] and da.loc[{'band': 'foo'}, ...] now work as expected.

da.loc[{'band': 'foo'}] still raises a KeyError. Although it is possible to catch this exception, it still remains ambiguous so it is probably better to do nothing.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/pydata/xarray/pull/802#issuecomment-201370448

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Multi-index indexing 143264649
201340940 https://github.com/pydata/xarray/pull/802#issuecomment-201340940 https://api.github.com/repos/pydata/xarray/issues/802 MDEyOklzc3VlQ29tbWVudDIwMTM0MDk0MA== shoyer 1217238 2016-03-25T15:51:02Z 2016-03-25T15:51:02Z MEMBER

Multi-index level drop only works when a dict is provided for a dimension, i.e., da.sel(band_wavenumber='foo') still returns the full pandas.MultiIndex. This would require for indexing.convert_label_indexer to return an updated index also when label is not dict-like, which is not that straightforward I think.

Indeed. This would require an another data structure somewhere keeping track of level names -- and ideally also ensuring that they are always unique (like dimensions). This seems fine to me for now.

There is a potential conflict when providing a dictionary to DataArray.loc, it may be interpreted either as a mapping of dimensions / labels or a mapping of index levels / labels for the 1st dimension. For now, the second option is not handled, e.g., da.loc[{'band': 'foo'}] raises a KeyError.

I agree -- better to require the user to be explicit. I also don't see many use cases for specifying the coordinate value and level name but not the dimension name. What happens if you type da.loc[{'band': 'foo'}, :] or da.loc[{'band': 'foo'}, ...]? In principle these are not ambiguous, but I could only guess at what happens without looking at the code.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Multi-index indexing 143264649
201125233 https://github.com/pydata/xarray/pull/802#issuecomment-201125233 https://api.github.com/repos/pydata/xarray/issues/802 MDEyOklzc3VlQ29tbWVudDIwMTEyNTIzMw== shoyer 1217238 2016-03-25T03:53:53Z 2016-03-25T03:53:53Z MEMBER

This looks very nice! I would probably opt for making drop_level=True the default for .loc -- it's hard to see when that wouldn't be desirable. In fact, I'm not even sure that it's worth having the option to set drop_level=False.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Multi-index indexing 143264649

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