home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 258327585

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/1074#issuecomment-258327585 https://api.github.com/repos/pydata/xarray/issues/1074 258327585 MDEyOklzc3VlQ29tbWVudDI1ODMyNzU4NQ== 1217238 2016-11-04T02:10:04Z 2016-11-04T02:10:04Z MEMBER

We could try to get in a simple version of this before #964.

My only concern is that the functionality here is slightly different from Dataset.apply, which takes functions that map DataArray -> DataArray or DataArray -> numpy.ndarray.

For DataArray.apply, we really want something that maps numpy.ndarray -> numpy.ndarray, which is now inconsistent. I guess we could pass the original DataArray to the function, but we already have a .pipe method for that.

This is also a concern for #964, because any new xarray.apply function would have similar consistency issues with Dataset.apply.

Two possible solutions, neither of which is fully satisfying: - New keyword argument raw to Dataset.apply, defaulting to False. Works like the raw argument to DataFrame.apply. If raw=True, then Dataset.apply passes unlabeled arrays to the provided function, like DataArray.apply. This makes the difference a little less jarring. - Pick a new name for one of these uses of apply, e.g., apply_raw for this use case. xarray.apply_raw or DataArray.apply_raw is pretty verbose, though.

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