home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 306067267

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
306067267 MDU6SXNzdWUzMDYwNjcyNjc= 1997 can't do in-place clip() with DataArrays. 291576 closed 0     4 2018-03-16T20:31:03Z 2020-02-19T22:59:08Z 2020-02-19T22:59:08Z CONTRIBUTOR      

Code Sample, a copy-pastable example if possible

Where foo is a DataArray, there doesn't seem to be a nice way to use clip() in-place. python foo.clip(0, None, out=foo) Traceback (most recent call last): File "<stdin>", line 1, in <module> foo.clip(0, None, out=foo) File "/rd22/scratch/broot/Programs/xarray/xarray/core/dataarray.py", line 1726, in func **kwargs)) File "/rd22/scratch/broot/Programs/xarray/xarray/core/ops.py", line 205, in func return _call_possibly_missing_method(self, name, args, kwargs) File "/rd22/scratch/broot/Programs/xarray/xarray/core/ops.py", line 192, in _call_possibly_missing_method return method(*args, **kwargs) TypeError: output must be an array You get a similar exception if you do np.clip(foo, ..., out=foo).

Problem description

Note the docstring for DataArray.clip(): ``` Help on method clip in module xarray.core.ops:

clip(self, args, *kwargs) method of xarray.core.dataarray.DataArray instance a.clip(min=None, max=None, out=None)

Return an array whose values are limited to ``[min, max]``.
One of max or min must be given.

Refer to `numpy.clip` for full documentation.

See Also
--------
numpy.clip : equivalent function

`` So, the docstring advertises support forout`.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1997/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 4 rows from issue in issue_comments
Powered by Datasette · Queries took 0.63ms · About: xarray-datasette