home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 317871442

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/1487#issuecomment-317871442 https://api.github.com/repos/pydata/xarray/issues/1487 317871442 MDEyOklzc3VlQ29tbWVudDMxNzg3MTQ0Mg== 1217238 2017-07-25T21:02:59Z 2017-07-25T21:02:59Z MEMBER

This is (somewhat) expected. Basically, you should use the DataArray.squeeze() method instead.

The long story is that some but not all NumPy functions define themselves by (attempting) to call methods, e.g., np.squeeze(array) -> array.squeeze().

squeeze is a special and somewhat surprising case. Apparently np.squeeze(array, axis) -> array.squeeze(axis) -> array.squeeze() if the axis argument isn't handled. But we didn't bother to define an axis argument for DataArray.squeeze(), so this results in an error.

I suppose we could fix this by defining an axis argument, like we do for some methods like .mean(). But the short answer is that using xarray methods should be preferred.

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