{"action":"closed","number":41,"pull_request":{"url":"https://api.github.com/repos/ContinuumIO/dask/pulls/41","id":29759652,"html_url":"https://github.com/ContinuumIO/dask/pull/41","diff_url":"https://github.com/ContinuumIO/dask/pull/41.diff","patch_url":"https://github.com/ContinuumIO/dask/pull/41.patch","issue_url":"https://api.github.com/repos/ContinuumIO/dask/issues/41","number":41,"state":"closed","locked":false,"title":"Add argmin/argmax","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":"Add `argmin/argmax` to `dask.array`.  Note that this raises an exception when not given an axis argument as in  `x.argmin()`.  NumPy resorts to `x.flatten().argmin()` in this case which isn't as available to us because we don't think about data in a continuous way.\r\n\r\nExample\r\n-------\r\n\r\n```Python\r\nIn [1]: import numpy as np\r\n\r\nIn [2]: x = np.random.randint(10, size=(4, 4))\r\n\r\nIn [3]: x\r\nOut[3]: \r\narray([[5, 3, 8, 0],\r\n       [0, 2, 9, 2],\r\n       [3, 7, 2, 4],\r\n       [7, 1, 8, 9]])\r\n\r\nIn [4]: import dask.array as da\r\n\r\nIn [5]: d = da.from_array(x, blockshape=(2, 2))\r\n\r\nIn [6]: np.array(d.argmin(axis=0))\r\nOut[6]: array([1, 3, 2, 0])\r\n\r\nIn [7]: np.array(d.argmin(axis=1))\r\nOut[7]: array([3, 0, 2, 1])\r\n\r\nIn [8]: x.argmin(axis=0)\r\nOut[8]: array([1, 3, 2, 0])\r\n\r\nIn [10]: x.argmin(axis=1)\r\nOut[10]: array([3, 0, 2, 1])\r\n\r\nIn [11]: x.argmin()\r\nOut[11]: 3\r\n\r\nIn [12]: d.argmin()\r\nValueError: Must specify integer axis= keyword argument.\r\nFor example:\r\n  Before:  x.argmin()\r\n  After:   x.argmin(axis=0)\r\n```\r\n\r\nThis came up in conversation with @stefanv","created_at":"2015-02-21T20:41:42Z","updated_at":"2015-02-21T21:00:15Z","closed_at":"2015-02-21T21:00:15Z","merged_at":"2015-02-21T21:00:15Z","merge_commit_sha":"535e3dc3eb1241a418e0d604307d2b011840985a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ContinuumIO/dask/pulls/41/commits","review_comments_url":"https://api.github.com/repos/ContinuumIO/dask/pulls/41/comments","review_comment_url":"https://api.github.com/repos/ContinuumIO/dask/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ContinuumIO/dask/issues/41/comments","statuses_url":"https://api.github.com/repos/ContinuumIO/dask/statuses/d5772f803a2e9957a7fc04c3fefb7b017c39abf7","head":{"label":"mrocklin:argmin","ref":"argmin","sha":"d5772f803a2e9957a7fc04c3fefb7b017c39abf7","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-20T05:44:36Z","pushed_at":"2015-02-21T20:37:19Z","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":"55e55d28110726948ec0c7f0f27f3aef6c5e5d88","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-21T20:25:18Z","pushed_at":"2015-02-21T21:00:15Z","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":2,"forks":3,"open_issues":2,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ContinuumIO/dask/pulls/41"},"html":{"href":"https://github.com/ContinuumIO/dask/pull/41"},"issue":{"href":"https://api.github.com/repos/ContinuumIO/dask/issues/41"},"comments":{"href":"https://api.github.com/repos/ContinuumIO/dask/issues/41/comments"},"review_comments":{"href":"https://api.github.com/repos/ContinuumIO/dask/pulls/41/comments"},"review_comment":{"href":"https://api.github.com/repos/ContinuumIO/dask/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ContinuumIO/dask/pulls/41/commits"},"statuses":{"href":"https://api.github.com/repos/ContinuumIO/dask/statuses/d5772f803a2e9957a7fc04c3fefb7b017c39abf7"}},"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":2,"additions":94,"deletions":1,"changed_files":3}}