home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 234540415

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/432#issuecomment-234540415 https://api.github.com/repos/pydata/xarray/issues/432 234540415 MDEyOklzc3VlQ29tbWVudDIzNDU0MDQxNQ== 4806877 2016-07-22T13:14:43Z 2016-07-22T13:14:43Z CONTRIBUTOR

I agree.

.3. Couldn't this make the dict blow up for large datasets? Maybe there could be a flag that lets the user decide whether to leave the data in its current form (could use self.data in case it is a dask array) 6. The trouble with xarray.DataArray is that it doesn't require a name but it can have one. Is that something that we would want to preserve? If not, then maybe it would look more like this.

``` tolist=True

d = {'coords': {}, 'attrs': dict(self.attrs), 'dims': self.dims}

def func(x, tolist): if tolist: return x.tolist() return x

for k in self.coords: d['coords'].update({k: {'data': func(self[k].data, tolist), 'dims': list(self[k].dims), 'attrs': dict(self[k].attrs)}}) if hasattr(self, 'data_vars'): d.update({'data_vars': {}}) for k in self.data_vars: d['data_vars'].update({k: {'data': func(self[k].data, tolist), 'dims': list(self[k].dims), 'attrs': dict(self[k].attrs)}}) else: d.update({'data': func(self.data, tolist)}) ```

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