issues: 188395497
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
188395497 | MDU6SXNzdWUxODgzOTU0OTc= | 1102 | full_like, zeros_like, ones_like | 6213168 | closed | 0 | 2 | 2016-11-10T01:12:58Z | 2016-11-28T03:42:39Z | 2016-11-28T03:42:39Z | MEMBER | I'd like to add the following top-level functions to xarray: ``` def const_like(array, value=0): """Return a new array with the same shape of array and the given constant value. If array is dask-backed, return a new dask-backed array with the same chunks.
def zeros_like(array): return const_like(array, 0) def ones_like(array): return const_like(array, 1) ``` The above would need to be expanded to support Dataset and Variable objects. In Datasets, the data_vars would be constants whereas all other variables would be copied verbatim. Thoughts? |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/1102/reactions", "total_count": 4, "+1": 4, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |