home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 561261583

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/3580#issuecomment-561261583 https://api.github.com/repos/pydata/xarray/issues/3580 561261583 MDEyOklzc3VlQ29tbWVudDU2MTI2MTU4Mw== 8881170 2019-12-03T17:02:39Z 2019-12-03T17:02:39Z CONTRIBUTOR

I can't seem to replicate this issue for some reason. I have the same versions of xarray, numpy, and netCDF4 installed.

python-traceback IndexError: The indexing operation you are attempting to perform is not valid on netCDF4.Variable object. Try loading your data into memory first by calling .load().

This implies that it's having issues slicing numpy-style with a dask array. I bet if you load it into memory and slice that way it'll work. But at ~22GB you might not be able to do that.

The preferred way to slice in xarray is to use .sel() and .isel() to leverage the label-aware nature of xarray. So you should have no problem doing this operation explicitly with the following:

fullda['sst'].isel(M=0, S=0, X=0, Y=0). You of course don't need to slice the L dimension since you are taking the full thing, but the equivalent notation there is :fullda['sst'].isel(L=slice(0, None)).

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