home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 36469527

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/32#issuecomment-36469527 https://api.github.com/repos/pydata/xarray/issues/32 36469527 MDEyOklzc3VlQ29tbWVudDM2NDY5NTI3 1217238 2014-03-02T22:23:08Z 2014-03-03T02:23:19Z MEMBER

OK, I just added squeeze back in PR #34.

One change I made from in indexed_by from views is that it automatically squeezes out dimensions if you give an integer as the indexer. So fcst.indexed_by(height_above_ground=0) removes the height_above_ground dimension. If you wanted to keep that dimension with size 1, you would need to do fcst.indexed_by(height_above_ground=slice(0, 1)) or fcst.indexed_by(height_above_ground=[0]). This behavior is more consistent with numpy, especially because I use indexed_by under the hood for indexing with DatasetArray objects.

Your suggestion for __delitem__ is interesting but with the current implementation of squeeze (and indexed_by more generally) I'm not sure how to make it work, because we currently have to load a variable into memory as a numpy array to squeeze out a dimension. This means that deleting a variable could cause other variables to be loaded. My expectation (in general) is that deleting an item should only release resources, and do so in a fairly lightweight fashion.

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