home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 233994941

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/906#issuecomment-233994941 https://api.github.com/repos/pydata/xarray/issues/906 233994941 MDEyOklzc3VlQ29tbWVudDIzMzk5NDk0MQ== 1217238 2016-07-20T15:58:15Z 2016-07-20T15:58:15Z MEMBER

Here are two examples where we would need to do pick-by-index on the data no matter what:

python def demo_unstack(index): index = pandas.MultiIndex.from_tuples(index, names=['x', 'count']) s = pandas.Series(list(range(len(index))), index) print(s.unstack())

There is no order for one or more of the levels would be sorted:

python demo_unstack([ ['x0', 'first' ], ['x0', 'second'], ['x0', 'third' ], ['x1', 'third' ], ['x1', 'second'], ['x1', 'first' ], ])

count first second third x x0 0 1 2 x1 5 4 3 In [ ]:

Even more pathological: the multi-index doesn't even fill out every value in the cartesian product:

python demo_unstack([ ['x1', 'first' ], ['x1', 'second'], ['x0', 'first' ], ])

count first second x x0 2.0 NaN x1 0.0 1.0

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  166439490
Powered by Datasette · Queries took 0.654ms · About: xarray-datasette