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/835#issuecomment-274641365,https://api.github.com/repos/pydata/xarray/issues/835,274641365,MDEyOklzc3VlQ29tbWVudDI3NDY0MTM2NQ==,1217238,2017-01-23T22:41:31Z,2017-01-23T22:41:31Z,MEMBER,Fixed by #1204,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,149678642
https://github.com/pydata/xarray/issues/835#issuecomment-258688602,https://api.github.com/repos/pydata/xarray/issues/835,258688602,MDEyOklzc3VlQ29tbWVudDI1ODY4ODYwMg==,1217238,2016-11-06T15:34:39Z,2016-11-06T15:34:39Z,MEMBER,"Actually, we can just write:
```
def combine_first(left, right):
return ops.where(ops.notnull(left), left, right)
```
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,149678642
https://github.com/pydata/xarray/issues/835#issuecomment-212289815,https://api.github.com/repos/pydata/xarray/issues/835,212289815,MDEyOklzc3VlQ29tbWVudDIxMjI4OTgxNQ==,1217238,2016-04-20T07:07:30Z,2016-04-20T07:10:05Z,MEMBER,"I'm currently in the process of refactoring the merge code so this should be pretty easy to add in.
A few snippets that should come in handy:
``` python
def combine_first(arrays):
notnulls = [ops.notnull(array) for array in arrays]
first_notnull = ops.argmax(ops.stack(notnulls), axis=0)
return ops.choose(first_notnull, arrays)
def combine_if_equal(arrays):
combined = combine_first(arrays)
combined_null = ops.isnull(combined)
if not all(((combined == array) | combined_null).all() for array in arrays):
raise ValueError
return combined
```
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,149678642