home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 452219508

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/pull/2659#issuecomment-452219508 https://api.github.com/repos/pydata/xarray/issues/2659 452219508 MDEyOklzc3VlQ29tbWVudDQ1MjIxOTUwOA== 1197350 2019-01-08T08:48:03Z 2019-01-08T08:48:03Z MEMBER

Here is what the .to_dict(data=False) output looks like from the test example

python x = np.random.randn(10) y = np.random.randn(10) t = list('abcdefghij') ds = Dataset(OrderedDict([('a', ('t', x)), ('b', ('t', y)), ('t', ('t', t))])) ds.to_dict(data=False)

{'attrs': {}, 'coords': {'t': {'attrs': {}, 'dims': ('t',), 'dtype': '<U1', 'shape': (10,)}}, 'data_vars': {'a': {'attrs': {}, 'dims': ('t',), 'dtype': 'float64', 'shape': (10,)}, 'b': {'attrs': {}, 'dims': ('t',), 'dtype': 'float64', 'shape': (10,)}}, 'dims': {'t': 10}}

The one thing I don't like about this is the empty attributes. Maybe we could change it so that attrs is only included if it is non-empty. Alternatively, we coiuld add a squeeze_attrs option.

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