home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 291258269

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/1350#issuecomment-291258269 https://api.github.com/repos/pydata/xarray/issues/1350 291258269 MDEyOklzc3VlQ29tbWVudDI5MTI1ODI2OQ== 4295853 2017-04-03T20:07:13Z 2017-04-03T20:07:13Z CONTRIBUTOR

As it turns out this was found this hunting a more complicated bug, but I couldn't easily reproduce it via DataArrays from scratch. My guess is that solving this will most likely solve that issue:

```python ds = xr.open_dataset('mpaso.hist.0100-06-01_00000_potDensityOnly.nc') ds['latCell'] = ds.latCell*180.0/np.pi ds.set_coords('latCell', inplace=True)

potDen = ds.potentialDensity.where(ds.potentialDensity != 0, drop=True)

yieldingpython Traceback (most recent call last): File "./plot_potential_density.py", line 52, in <module> main() File "./plot_potential_density.py", line 16, in main potDen = ds.potentialDensity.where(ds.potentialDensity != 0, drop=True) File "/Users/pwolfram/anaconda/lib/python2.7/site-packages/xarray/core/common.py", line 627, in where outobj = self.sel(indexers) File "/Users/pwolfram/anaconda/lib/python2.7/site-packages/xarray/core/dataarray.py", line 672, in sel result = self.isel(drop=drop, pos_indexers) File "/Users/pwolfram/anaconda/lib/python2.7/site-packages/xarray/core/dataarray.py", line 657, in isel ds = self._to_temp_dataset().isel(drop=drop, indexers) File "/Users/pwolfram/anaconda/lib/python2.7/site-packages/xarray/core/dataset.py", line 1119, in isel new_var = var.isel(var_indexers) File "/Users/pwolfram/anaconda/lib/python2.7/site-packages/xarray/core/variable.py", line 548, in isel return self[tuple(key)] File "/Users/pwolfram/anaconda/lib/python2.7/site-packages/xarray/core/variable.py", line 378, in getitem values = self._indexable_data[key] File "/Users/pwolfram/anaconda/lib/python2.7/site-packages/xarray/core/indexing.py", line 423, in getitem return type(self)(self.array[key]) IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (1,) (235446,) (100,) ```

It is possible that ds.set_coords('latCell', inplace=True) is part of the problem for this bug, so it may actually be a few problems, not just one.

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