{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/xarray/issues/1651","repository_url":"https://api.github.com/repos/pydata/xarray","labels_url":"https://api.github.com/repos/pydata/xarray/issues/1651/labels{/name}","comments_url":"https://api.github.com/repos/pydata/xarray/issues/1651/comments","events_url":"https://api.github.com/repos/pydata/xarray/issues/1651/events","html_url":"https://github.com/pydata/xarray/issues/1651","id":267826297,"number":1651,"title":"ENH: Forward & back fill methods","user":{"login":"MaximilianR","id":5635139,"avatar_url":"https://avatars0.githubusercontent.com/u/5635139?v=4","gravatar_id":"","url":"https://api.github.com/users/MaximilianR","html_url":"https://github.com/MaximilianR","followers_url":"https://api.github.com/users/MaximilianR/followers","following_url":"https://api.github.com/users/MaximilianR/following{/other_user}","gists_url":"https://api.github.com/users/MaximilianR/gists{/gist_id}","starred_url":"https://api.github.com/users/MaximilianR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaximilianR/subscriptions","organizations_url":"https://api.github.com/users/MaximilianR/orgs","repos_url":"https://api.github.com/users/MaximilianR/repos","events_url":"https://api.github.com/users/MaximilianR/events{/privacy}","received_events_url":"https://api.github.com/users/MaximilianR/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-10-23T21:39:18Z","updated_at":"2017-10-24T03:18:37Z","closed_at":null,"author_association":"COLLABORATOR","body":"I think with `np.flip` and `bn.push`, this should be simple. They're both fairly new and so would require version checks / upgrading the minimums.\r\n\r\nOne small issue, I wonder if anyone has come across this: `bottleneck` returns the numpy array rather than the DataArray - is that because it's not operating with the correct numpy interface?\r\n\r\nForward fill:\r\n```\r\narray.values = bn.push(array.values, axis=array.get_axis_num(axis_name))\r\n```\r\n\r\nBackfill:\r\n```\r\naxis = array.get_axis_num(axis_name)\r\n\r\n# reverse for bfill\r\narray = np.flip(array, axis=axis)\r\n\r\n# fill \r\narray.values = bn.push(array.values, axis=axis)\r\n\r\n# reverse back to original\r\nresult = np.flip(scaling, axis=date_axis)\r\n```"},"comment":{"url":"https://api.github.com/repos/pydata/xarray/issues/comments/338860711","html_url":"https://github.com/pydata/xarray/issues/1651#issuecomment-338860711","issue_url":"https://api.github.com/repos/pydata/xarray/issues/1651","id":338860711,"user":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars2.githubusercontent.com/u/1217238?v=4","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"created_at":"2017-10-24T03:18:37Z","updated_at":"2017-10-24T03:18:37Z","author_association":"OWNER","body":"Other numpy functions, e.g., `flip` check for some attributes and then assume duck type compatibility if found. For example, `flip` is turned into an indexing call."}}
{"actor":{"display_login":"shoyer"}}