home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 354705941

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/1805#issuecomment-354705941 https://api.github.com/repos/pydata/xarray/issues/1805 354705941 MDEyOklzc3VlQ29tbWVudDM1NDcwNTk0MQ== 1217238 2018-01-02T05:40:38Z 2018-01-02T05:57:03Z MEMBER

OK, I can reproduce this. The problem is assigning to specific elements of .values when a DataArray's data is not stored as a NumPy array, e.g., if it is a dask array or one of xarray's lazy array classes (used internally for lazy access when opening netCDF files). In practice, this arises with open_mfdataset() or open_dataset(..., cache=False).

It's not entirely obvious how to fix this. Probably the simplest fix is to make .values a readonly numpy array in these cases, so that an error is raised in these cases. This would usually works, but could lead to issues with passing arrays to scikit-learn or pandas due to a Cython bug with read-only memoryview buffers (https://github.com/cython/cython/issues/1605).

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