{"action":"created","comment":{"url":"https://api.github.com/repos/scipy/scipy/pulls/comments/44848349","id":44848349,"diff_hunk":"@@ -105,6 +106,20 @@ def test_1d_range_keyword(self):\n         assert_array_almost_equal(mean, mean_range2)\n         assert_array_almost_equal(bins, bins_range2)\n \n+    def test_1d_multi_values(self):\n+        x = self.x\n+        v = self.v\n+        w = self.w\n+\n+        stat1v, edges1v, bc1v = binned_statistic(x, v, 'mean', bins=10)\n+        stat1w, edges1w, bc1w = binned_statistic(x, w, 'mean', bins=10)\n+        stat2, edges2, bc2 = binned_statistic(x, [v, w], 'mean', bins=10)\n+\n+        assert_array_almost_equal(stat2[0], stat1v)\n+        assert_array_almost_equal(stat2[1], stat1w)\n+        assert_array_almost_equal(edges1v, edges2)\n+        assert_array_almost_equal(bc1v, bc2)","path":"scipy/stats/tests/test_binned_statistic.py","position":33,"original_position":33,"commit_id":"7bf57af0f2582b476bd908bee95d74b66eeff814","original_commit_id":"7bf57af0f2582b476bd908bee95d74b66eeff814","user":{"login":"jakevdp","id":781659,"avatar_url":"https://avatars.githubusercontent.com/u/781659?v=3","gravatar_id":"","url":"https://api.github.com/users/jakevdp","html_url":"https://github.com/jakevdp","followers_url":"https://api.github.com/users/jakevdp/followers","following_url":"https://api.github.com/users/jakevdp/following{/other_user}","gists_url":"https://api.github.com/users/jakevdp/gists{/gist_id}","starred_url":"https://api.github.com/users/jakevdp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakevdp/subscriptions","organizations_url":"https://api.github.com/users/jakevdp/orgs","repos_url":"https://api.github.com/users/jakevdp/repos","events_url":"https://api.github.com/users/jakevdp/events{/privacy}","received_events_url":"https://api.github.com/users/jakevdp/received_events","type":"User","site_admin":false},"body":"I think ``assert_allclose`` is preferred these days, but I'm not certain...","created_at":"2015-11-14T00:06:24Z","updated_at":"2015-11-14T00:06:24Z","html_url":"https://github.com/scipy/scipy/pull/5497#discussion_r44848349","pull_request_url":"https://api.github.com/repos/scipy/scipy/pulls/5497","_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments/44848349"},"html":{"href":"https://github.com/scipy/scipy/pull/5497#discussion_r44848349"},"pull_request":{"href":"https://api.github.com/repos/scipy/scipy/pulls/5497"}}},"pull_request":{"url":"https://api.github.com/repos/scipy/scipy/pulls/5497","id":50696058,"html_url":"https://github.com/scipy/scipy/pull/5497","diff_url":"https://github.com/scipy/scipy/pull/5497.diff","patch_url":"https://github.com/scipy/scipy/pull/5497.patch","issue_url":"https://api.github.com/repos/scipy/scipy/issues/5497","number":5497,"state":"open","locked":false,"title":"Enhancement to binned_statistic: option to unraveled returned bin-number mappings, and able to pass multiple data arrays at once","user":{"login":"lzkelley","id":3839265,"avatar_url":"https://avatars.githubusercontent.com/u/3839265?v=3","gravatar_id":"","url":"https://api.github.com/users/lzkelley","html_url":"https://github.com/lzkelley","followers_url":"https://api.github.com/users/lzkelley/followers","following_url":"https://api.github.com/users/lzkelley/following{/other_user}","gists_url":"https://api.github.com/users/lzkelley/gists{/gist_id}","starred_url":"https://api.github.com/users/lzkelley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lzkelley/subscriptions","organizations_url":"https://api.github.com/users/lzkelley/orgs","repos_url":"https://api.github.com/users/lzkelley/repos","events_url":"https://api.github.com/users/lzkelley/events{/privacy}","received_events_url":"https://api.github.com/users/lzkelley/received_events","type":"User","site_admin":false},"body":"This PR addresses two issues:  \r\n-   [Scipy 5449](https://github.com/scipy/scipy/issues/5449): `binned_statistic_2d` and `binned_statistic_dd` return mappings from the input data arrays to the bins they are placed in.  The mapping used (row-major) linearized bin indices, without documentation.  The enhancements in this PR both improve the documentation for the same behavior, and provide an input argument (`expand_binnumbers = False`) which, when True, unravels the bin-number mapping into an ndarray where each row gives the bins for each corresponding dimension.\r\n\r\n-   [Numpy 4718](https://github.com/numpy/numpy/issues/4718): It was suggested that it would be useful for histogram to operate on numerous 'weightings' simulataneously (e.g. when calculating histogrammed moments).  For example, Previously:\r\n    `stats_v, edges, bins = scipy.stats.binned_statisic(x, v, statistic='mean')`\r\n    `stats_w, edges, bins = scipy.stats.binned_statisic(x, w, statistic='mean')`\r\nNew:\r\n    `(stats_v, stats_w), edges, bins = scipy.stats.binned_statisic(x, (v, w), statistic='mean')`\r\n\r\nThe documentation has been expanded to reflect the new functionality, and tests have been added.  Additionally, I've changed some of the variable names for consistency (e.g. using `x_edges` instead of `x_edge` to be consistent with `bin_edges`, etc), and for clarity (e.g. changed `sampBin` instead of `Ncount` for a variable which stores which bin each sample belongs in).","created_at":"2015-11-13T21:46:04Z","updated_at":"2015-11-14T00:06:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b13adb0653c921e6b78b618855636d4db03fa2d2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scipy/scipy/pulls/5497/commits","review_comments_url":"https://api.github.com/repos/scipy/scipy/pulls/5497/comments","review_comment_url":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/5497/comments","statuses_url":"https://api.github.com/repos/scipy/scipy/statuses/7bf57af0f2582b476bd908bee95d74b66eeff814","head":{"label":"lzkelley:binned_statistic_updates","ref":"binned_statistic_updates","sha":"7bf57af0f2582b476bd908bee95d74b66eeff814","user":{"login":"lzkelley","id":3839265,"avatar_url":"https://avatars.githubusercontent.com/u/3839265?v=3","gravatar_id":"","url":"https://api.github.com/users/lzkelley","html_url":"https://github.com/lzkelley","followers_url":"https://api.github.com/users/lzkelley/followers","following_url":"https://api.github.com/users/lzkelley/following{/other_user}","gists_url":"https://api.github.com/users/lzkelley/gists{/gist_id}","starred_url":"https://api.github.com/users/lzkelley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lzkelley/subscriptions","organizations_url":"https://api.github.com/users/lzkelley/orgs","repos_url":"https://api.github.com/users/lzkelley/repos","events_url":"https://api.github.com/users/lzkelley/events{/privacy}","received_events_url":"https://api.github.com/users/lzkelley/received_events","type":"User","site_admin":false},"repo":{"id":44717303,"name":"scipy","full_name":"lzkelley/scipy","owner":{"login":"lzkelley","id":3839265,"avatar_url":"https://avatars.githubusercontent.com/u/3839265?v=3","gravatar_id":"","url":"https://api.github.com/users/lzkelley","html_url":"https://github.com/lzkelley","followers_url":"https://api.github.com/users/lzkelley/followers","following_url":"https://api.github.com/users/lzkelley/following{/other_user}","gists_url":"https://api.github.com/users/lzkelley/gists{/gist_id}","starred_url":"https://api.github.com/users/lzkelley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lzkelley/subscriptions","organizations_url":"https://api.github.com/users/lzkelley/orgs","repos_url":"https://api.github.com/users/lzkelley/repos","events_url":"https://api.github.com/users/lzkelley/events{/privacy}","received_events_url":"https://api.github.com/users/lzkelley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lzkelley/scipy","description":"Scipy library main repository","fork":true,"url":"https://api.github.com/repos/lzkelley/scipy","forks_url":"https://api.github.com/repos/lzkelley/scipy/forks","keys_url":"https://api.github.com/repos/lzkelley/scipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lzkelley/scipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lzkelley/scipy/teams","hooks_url":"https://api.github.com/repos/lzkelley/scipy/hooks","issue_events_url":"https://api.github.com/repos/lzkelley/scipy/issues/events{/number}","events_url":"https://api.github.com/repos/lzkelley/scipy/events","assignees_url":"https://api.github.com/repos/lzkelley/scipy/assignees{/user}","branches_url":"https://api.github.com/repos/lzkelley/scipy/branches{/branch}","tags_url":"https://api.github.com/repos/lzkelley/scipy/tags","blobs_url":"https://api.github.com/repos/lzkelley/scipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lzkelley/scipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lzkelley/scipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/lzkelley/scipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lzkelley/scipy/statuses/{sha}","languages_url":"https://api.github.com/repos/lzkelley/scipy/languages","stargazers_url":"https://api.github.com/repos/lzkelley/scipy/stargazers","contributors_url":"https://api.github.com/repos/lzkelley/scipy/contributors","subscribers_url":"https://api.github.com/repos/lzkelley/scipy/subscribers","subscription_url":"https://api.github.com/repos/lzkelley/scipy/subscription","commits_url":"https://api.github.com/repos/lzkelley/scipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/lzkelley/scipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/lzkelley/scipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/lzkelley/scipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/lzkelley/scipy/contents/{+path}","compare_url":"https://api.github.com/repos/lzkelley/scipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lzkelley/scipy/merges","archive_url":"https://api.github.com/repos/lzkelley/scipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lzkelley/scipy/downloads","issues_url":"https://api.github.com/repos/lzkelley/scipy/issues{/number}","pulls_url":"https://api.github.com/repos/lzkelley/scipy/pulls{/number}","milestones_url":"https://api.github.com/repos/lzkelley/scipy/milestones{/number}","notifications_url":"https://api.github.com/repos/lzkelley/scipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lzkelley/scipy/labels{/name}","releases_url":"https://api.github.com/repos/lzkelley/scipy/releases{/id}","created_at":"2015-10-22T02:30:58Z","updated_at":"2015-10-22T02:31:16Z","pushed_at":"2015-11-13T22:44:41Z","git_url":"git://github.com/lzkelley/scipy.git","ssh_url":"git@github.com:lzkelley/scipy.git","clone_url":"https://github.com/lzkelley/scipy.git","svn_url":"https://github.com/lzkelley/scipy","homepage":"http://scipy.org/scipylib/","size":58705,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scipy:master","ref":"master","sha":"05ec4c62e4b5a2430492ac435e289433b22d8075","user":{"login":"scipy","id":288277,"avatar_url":"https://avatars.githubusercontent.com/u/288277?v=3","gravatar_id":"","url":"https://api.github.com/users/scipy","html_url":"https://github.com/scipy","followers_url":"https://api.github.com/users/scipy/followers","following_url":"https://api.github.com/users/scipy/following{/other_user}","gists_url":"https://api.github.com/users/scipy/gists{/gist_id}","starred_url":"https://api.github.com/users/scipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scipy/subscriptions","organizations_url":"https://api.github.com/users/scipy/orgs","repos_url":"https://api.github.com/users/scipy/repos","events_url":"https://api.github.com/users/scipy/events{/privacy}","received_events_url":"https://api.github.com/users/scipy/received_events","type":"Organization","site_admin":false},"repo":{"id":1460385,"name":"scipy","full_name":"scipy/scipy","owner":{"login":"scipy","id":288277,"avatar_url":"https://avatars.githubusercontent.com/u/288277?v=3","gravatar_id":"","url":"https://api.github.com/users/scipy","html_url":"https://github.com/scipy","followers_url":"https://api.github.com/users/scipy/followers","following_url":"https://api.github.com/users/scipy/following{/other_user}","gists_url":"https://api.github.com/users/scipy/gists{/gist_id}","starred_url":"https://api.github.com/users/scipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scipy/subscriptions","organizations_url":"https://api.github.com/users/scipy/orgs","repos_url":"https://api.github.com/users/scipy/repos","events_url":"https://api.github.com/users/scipy/events{/privacy}","received_events_url":"https://api.github.com/users/scipy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scipy/scipy","description":"Scipy library main repository","fork":false,"url":"https://api.github.com/repos/scipy/scipy","forks_url":"https://api.github.com/repos/scipy/scipy/forks","keys_url":"https://api.github.com/repos/scipy/scipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scipy/scipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scipy/scipy/teams","hooks_url":"https://api.github.com/repos/scipy/scipy/hooks","issue_events_url":"https://api.github.com/repos/scipy/scipy/issues/events{/number}","events_url":"https://api.github.com/repos/scipy/scipy/events","assignees_url":"https://api.github.com/repos/scipy/scipy/assignees{/user}","branches_url":"https://api.github.com/repos/scipy/scipy/branches{/branch}","tags_url":"https://api.github.com/repos/scipy/scipy/tags","blobs_url":"https://api.github.com/repos/scipy/scipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scipy/scipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scipy/scipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/scipy/scipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scipy/scipy/statuses/{sha}","languages_url":"https://api.github.com/repos/scipy/scipy/languages","stargazers_url":"https://api.github.com/repos/scipy/scipy/stargazers","contributors_url":"https://api.github.com/repos/scipy/scipy/contributors","subscribers_url":"https://api.github.com/repos/scipy/scipy/subscribers","subscription_url":"https://api.github.com/repos/scipy/scipy/subscription","commits_url":"https://api.github.com/repos/scipy/scipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/scipy/scipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/scipy/scipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/scipy/scipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/scipy/scipy/contents/{+path}","compare_url":"https://api.github.com/repos/scipy/scipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scipy/scipy/merges","archive_url":"https://api.github.com/repos/scipy/scipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scipy/scipy/downloads","issues_url":"https://api.github.com/repos/scipy/scipy/issues{/number}","pulls_url":"https://api.github.com/repos/scipy/scipy/pulls{/number}","milestones_url":"https://api.github.com/repos/scipy/scipy/milestones{/number}","notifications_url":"https://api.github.com/repos/scipy/scipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scipy/scipy/labels{/name}","releases_url":"https://api.github.com/repos/scipy/scipy/releases{/id}","created_at":"2011-03-09T18:52:03Z","updated_at":"2015-11-13T18:25:09Z","pushed_at":"2015-11-13T22:44:42Z","git_url":"git://github.com/scipy/scipy.git","ssh_url":"git@github.com:scipy/scipy.git","clone_url":"https://github.com/scipy/scipy.git","svn_url":"https://github.com/scipy/scipy","homepage":"http://scipy.org/scipylib/","size":96398,"stargazers_count":1933,"watchers_count":1933,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1100,"mirror_url":null,"open_issues_count":918,"forks":1100,"open_issues":918,"watchers":1933,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/5497"},"html":{"href":"https://github.com/scipy/scipy/pull/5497"},"issue":{"href":"https://api.github.com/repos/scipy/scipy/issues/5497"},"comments":{"href":"https://api.github.com/repos/scipy/scipy/issues/5497/comments"},"review_comments":{"href":"https://api.github.com/repos/scipy/scipy/pulls/5497/comments"},"review_comment":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scipy/scipy/pulls/5497/commits"},"statuses":{"href":"https://api.github.com/repos/scipy/scipy/statuses/7bf57af0f2582b476bd908bee95d74b66eeff814"}}}}