{"action":"closed","number":42,"pull_request":{"url":"https://api.github.com/repos/ContinuumIO/dask/pulls/42","id":29760681,"html_url":"https://github.com/ContinuumIO/dask/pull/42","diff_url":"https://github.com/ContinuumIO/dask/pull/42.diff","patch_url":"https://github.com/ContinuumIO/dask/pull/42.patch","issue_url":"https://api.github.com/repos/ContinuumIO/dask/issues/42","number":42,"state":"closed","locked":false,"title":"Add NaN-aware reductions","user":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars.githubusercontent.com/u/306380?v=3","gravatar_id":"","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"body":"These use np.nansum, np.nanmin, etc. to implement da.nansum, da.nanmean, etc.\r\n\r\nExample\r\n-------\r\n\r\n    In [1]: import numpy as np\r\n\r\n    In [2]: import dask.array as da\r\n\r\n    In [3]: x = np.array([[1, np.nan, 3, 4],\r\n       ...:               [5, 6, 7, np.nan],\r\n          ...:               [9, 10, 11, 12]])\r\n\r\n    In [4]: d = da.from_array(x, blockshape=(2, 2))\r\n\r\n    In [5]: np.nansum(x)\r\n    Out[5]: 68.0\r\n\r\n    In [6]: np.nansum(x, axis=0)\r\n    Out[6]: array([ 15.,  16.,  21.,  16.])\r\n\r\n    In [7]: da.nansum(d).compute()\r\n    Out[7]: 68.0\r\n\r\n    In [8]: da.nansum(d, axis=0).compute()\r\n    Out[8]: array([ 15.,  16.,  21.,  16.])\r\n\r\n    In [9]: da.nanstd(d, axis=0).compute()\r\n    Out[9]: array([ 3.26598632,  2.        ,  3.26598632,  4.        ])\r\n\r\n    In [10]: np.nanstd(x, axis=0)\r\n    Out[10]: array([ 3.26598632,  2.        ,  3.26598632,  4.        ])\r\n\r\ncc @shoyer https://github.com/xray/xray/issues/328","created_at":"2015-02-21T21:47:36Z","updated_at":"2015-02-22T16:03:36Z","closed_at":"2015-02-22T16:03:36Z","merged_at":"2015-02-22T16:03:36Z","merge_commit_sha":"7a65843ba652d1bde2cad1de87757bbf370402a1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ContinuumIO/dask/pulls/42/commits","review_comments_url":"https://api.github.com/repos/ContinuumIO/dask/pulls/42/comments","review_comment_url":"https://api.github.com/repos/ContinuumIO/dask/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ContinuumIO/dask/issues/42/comments","statuses_url":"https://api.github.com/repos/ContinuumIO/dask/statuses/66cd6a25d23be0dfefd03877957c41903864f40c","head":{"label":"mrocklin:nan-reductions","ref":"nan-reductions","sha":"66cd6a25d23be0dfefd03877957c41903864f40c","user":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars.githubusercontent.com/u/306380?v=3","gravatar_id":"","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"repo":{"id":28313768,"name":"dask","full_name":"mrocklin/dask","owner":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars.githubusercontent.com/u/306380?v=3","gravatar_id":"","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrocklin/dask","description":"Minimal task scheduling abstraction","fork":false,"url":"https://api.github.com/repos/mrocklin/dask","forks_url":"https://api.github.com/repos/mrocklin/dask/forks","keys_url":"https://api.github.com/repos/mrocklin/dask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrocklin/dask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrocklin/dask/teams","hooks_url":"https://api.github.com/repos/mrocklin/dask/hooks","issue_events_url":"https://api.github.com/repos/mrocklin/dask/issues/events{/number}","events_url":"https://api.github.com/repos/mrocklin/dask/events","assignees_url":"https://api.github.com/repos/mrocklin/dask/assignees{/user}","branches_url":"https://api.github.com/repos/mrocklin/dask/branches{/branch}","tags_url":"https://api.github.com/repos/mrocklin/dask/tags","blobs_url":"https://api.github.com/repos/mrocklin/dask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrocklin/dask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrocklin/dask/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrocklin/dask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrocklin/dask/statuses/{sha}","languages_url":"https://api.github.com/repos/mrocklin/dask/languages","stargazers_url":"https://api.github.com/repos/mrocklin/dask/stargazers","contributors_url":"https://api.github.com/repos/mrocklin/dask/contributors","subscribers_url":"https://api.github.com/repos/mrocklin/dask/subscribers","subscription_url":"https://api.github.com/repos/mrocklin/dask/subscription","commits_url":"https://api.github.com/repos/mrocklin/dask/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrocklin/dask/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrocklin/dask/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrocklin/dask/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrocklin/dask/contents/{+path}","compare_url":"https://api.github.com/repos/mrocklin/dask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrocklin/dask/merges","archive_url":"https://api.github.com/repos/mrocklin/dask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrocklin/dask/downloads","issues_url":"https://api.github.com/repos/mrocklin/dask/issues{/number}","pulls_url":"https://api.github.com/repos/mrocklin/dask/pulls{/number}","milestones_url":"https://api.github.com/repos/mrocklin/dask/milestones{/number}","notifications_url":"https://api.github.com/repos/mrocklin/dask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrocklin/dask/labels{/name}","releases_url":"https://api.github.com/repos/mrocklin/dask/releases{/id}","created_at":"2014-12-21T21:26:56Z","updated_at":"2015-02-22T03:01:42Z","pushed_at":"2015-02-22T03:35:03Z","git_url":"git://github.com/mrocklin/dask.git","ssh_url":"git@github.com:mrocklin/dask.git","clone_url":"https://github.com/mrocklin/dask.git","svn_url":"https://github.com/mrocklin/dask","homepage":"","size":1600,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":0,"forks":6,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"ContinuumIO:master","ref":"master","sha":"e0963223cd60e7cc86ce4032c42af9bf63c790c7","user":{"login":"ContinuumIO","id":1158637,"avatar_url":"https://avatars.githubusercontent.com/u/1158637?v=3","gravatar_id":"","url":"https://api.github.com/users/ContinuumIO","html_url":"https://github.com/ContinuumIO","followers_url":"https://api.github.com/users/ContinuumIO/followers","following_url":"https://api.github.com/users/ContinuumIO/following{/other_user}","gists_url":"https://api.github.com/users/ContinuumIO/gists{/gist_id}","starred_url":"https://api.github.com/users/ContinuumIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ContinuumIO/subscriptions","organizations_url":"https://api.github.com/users/ContinuumIO/orgs","repos_url":"https://api.github.com/users/ContinuumIO/repos","events_url":"https://api.github.com/users/ContinuumIO/events{/privacy}","received_events_url":"https://api.github.com/users/ContinuumIO/received_events","type":"Organization","site_admin":false},"repo":{"id":28782747,"name":"dask","full_name":"ContinuumIO/dask","owner":{"login":"ContinuumIO","id":1158637,"avatar_url":"https://avatars.githubusercontent.com/u/1158637?v=3","gravatar_id":"","url":"https://api.github.com/users/ContinuumIO","html_url":"https://github.com/ContinuumIO","followers_url":"https://api.github.com/users/ContinuumIO/followers","following_url":"https://api.github.com/users/ContinuumIO/following{/other_user}","gists_url":"https://api.github.com/users/ContinuumIO/gists{/gist_id}","starred_url":"https://api.github.com/users/ContinuumIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ContinuumIO/subscriptions","organizations_url":"https://api.github.com/users/ContinuumIO/orgs","repos_url":"https://api.github.com/users/ContinuumIO/repos","events_url":"https://api.github.com/users/ContinuumIO/events{/privacy}","received_events_url":"https://api.github.com/users/ContinuumIO/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ContinuumIO/dask","description":"Minimal task scheduling abstraction","fork":true,"url":"https://api.github.com/repos/ContinuumIO/dask","forks_url":"https://api.github.com/repos/ContinuumIO/dask/forks","keys_url":"https://api.github.com/repos/ContinuumIO/dask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ContinuumIO/dask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ContinuumIO/dask/teams","hooks_url":"https://api.github.com/repos/ContinuumIO/dask/hooks","issue_events_url":"https://api.github.com/repos/ContinuumIO/dask/issues/events{/number}","events_url":"https://api.github.com/repos/ContinuumIO/dask/events","assignees_url":"https://api.github.com/repos/ContinuumIO/dask/assignees{/user}","branches_url":"https://api.github.com/repos/ContinuumIO/dask/branches{/branch}","tags_url":"https://api.github.com/repos/ContinuumIO/dask/tags","blobs_url":"https://api.github.com/repos/ContinuumIO/dask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ContinuumIO/dask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ContinuumIO/dask/git/refs{/sha}","trees_url":"https://api.github.com/repos/ContinuumIO/dask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ContinuumIO/dask/statuses/{sha}","languages_url":"https://api.github.com/repos/ContinuumIO/dask/languages","stargazers_url":"https://api.github.com/repos/ContinuumIO/dask/stargazers","contributors_url":"https://api.github.com/repos/ContinuumIO/dask/contributors","subscribers_url":"https://api.github.com/repos/ContinuumIO/dask/subscribers","subscription_url":"https://api.github.com/repos/ContinuumIO/dask/subscription","commits_url":"https://api.github.com/repos/ContinuumIO/dask/commits{/sha}","git_commits_url":"https://api.github.com/repos/ContinuumIO/dask/git/commits{/sha}","comments_url":"https://api.github.com/repos/ContinuumIO/dask/comments{/number}","issue_comment_url":"https://api.github.com/repos/ContinuumIO/dask/issues/comments{/number}","contents_url":"https://api.github.com/repos/ContinuumIO/dask/contents/{+path}","compare_url":"https://api.github.com/repos/ContinuumIO/dask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ContinuumIO/dask/merges","archive_url":"https://api.github.com/repos/ContinuumIO/dask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ContinuumIO/dask/downloads","issues_url":"https://api.github.com/repos/ContinuumIO/dask/issues{/number}","pulls_url":"https://api.github.com/repos/ContinuumIO/dask/pulls{/number}","milestones_url":"https://api.github.com/repos/ContinuumIO/dask/milestones{/number}","notifications_url":"https://api.github.com/repos/ContinuumIO/dask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ContinuumIO/dask/labels{/name}","releases_url":"https://api.github.com/repos/ContinuumIO/dask/releases{/id}","created_at":"2015-01-04T18:50:00Z","updated_at":"2015-02-22T02:53:09Z","pushed_at":"2015-02-22T16:03:36Z","git_url":"git://github.com/ContinuumIO/dask.git","ssh_url":"git@github.com:ContinuumIO/dask.git","clone_url":"https://github.com/ContinuumIO/dask.git","svn_url":"https://github.com/ContinuumIO/dask","homepage":"","size":1718,"stargazers_count":15,"watchers_count":15,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ContinuumIO/dask/pulls/42"},"html":{"href":"https://github.com/ContinuumIO/dask/pull/42"},"issue":{"href":"https://api.github.com/repos/ContinuumIO/dask/issues/42"},"comments":{"href":"https://api.github.com/repos/ContinuumIO/dask/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/ContinuumIO/dask/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/ContinuumIO/dask/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ContinuumIO/dask/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/ContinuumIO/dask/statuses/66cd6a25d23be0dfefd03877957c41903864f40c"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars.githubusercontent.com/u/306380?v=3","gravatar_id":"","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":4,"additions":141,"deletions":37,"changed_files":5}}