{"action":"created","comment":{"url":"https://api.github.com/repos/scipy/scipy/pulls/comments/46081733","id":46081733,"diff_hunk":"@@ -4591,6 +4589,59 @@ def ks_2samp(data1, data2):\n \n     return Ks_2sampResult(d, prob)\n \n+\n+def tiecorrect(rankvals):\n+    \"\"\"\n+    tiecorrect(rankvals)\n+\n+    Tie correction factor for ties in the Mann-Whitney U and\n+    Kruskal-Wallis H tests.\n+\n+    Parameters\n+    ----------\n+    rankvals : array_like\n+        A 1-D sequence of ranks.  Typically this will be the array\n+        returned by `stats.rankdata`.\n+\n+    Returns\n+    -------\n+    factor : float\n+        Correction factor for U or H.\n+\n+    See Also\n+    --------\n+    rankdata : Assign ranks to the data\n+    mannwhitneyu : Mann-Whitney rank test\n+    kruskal : Kruskal-Wallis H test\n+\n+    References\n+    ----------\n+    .. [1] Siegel, S. (1956) Nonparametric Statistics for the Behavioral\n+           Sciences.  New York: McGraw-Hill.\n+\n+    Examples\n+    --------\n+    >>> from scipy.stats import tiecorrect, rankdata\n+    >>> tiecorrect([1, 2.5, 2.5, 4])\n+    0.9\n+    >>> ranks = rankdata([1, 3, 2, 4, 5, 7, 2, 8, 4])\n+    >>> ranks\n+    array([ 1. ,  4. ,  2.5,  5.5,  7. ,  8. ,  2.5,  9. ,  5.5])\n+    >>> tiecorrect(ranks)\n+    0.9833333333333333\n+\n+    \"\"\"\n+    arr = np.sort(rankvals)\n+    idx = np.nonzero(np.r_[True, arr[1:] != arr[:-1], True])[0]\n+    cnt = np.diff(idx).astype(np.int64)\n+\n+    if (np.int64(1 << 20) < cnt).any():  # gaurd overflow\n+        cnt = cnt.astype(np.float64)","path":"scipy/stats/stats.py","position":60,"original_position":60,"commit_id":"8b0625708fa8fa54405ca37f5f93c02fa0a01b06","original_commit_id":"8b0625708fa8fa54405ca37f5f93c02fa0a01b06","user":{"login":"ev-br","id":2133832,"avatar_url":"https://avatars.githubusercontent.com/u/2133832?v=3","gravatar_id":"","url":"https://api.github.com/users/ev-br","html_url":"https://github.com/ev-br","followers_url":"https://api.github.com/users/ev-br/followers","following_url":"https://api.github.com/users/ev-br/following{/other_user}","gists_url":"https://api.github.com/users/ev-br/gists{/gist_id}","starred_url":"https://api.github.com/users/ev-br/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ev-br/subscriptions","organizations_url":"https://api.github.com/users/ev-br/orgs","repos_url":"https://api.github.com/users/ev-br/repos","events_url":"https://api.github.com/users/ev-br/events{/privacy}","received_events_url":"https://api.github.com/users/ev-br/received_events","type":"User","site_admin":false},"body":"Do you really need two copies here? I mean, a cast to int64 then to float64, both copy. ","created_at":"2015-11-28T16:42:00Z","updated_at":"2015-11-28T16:42:00Z","html_url":"https://github.com/scipy/scipy/pull/5554#discussion_r46081733","pull_request_url":"https://api.github.com/repos/scipy/scipy/pulls/5554","_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments/46081733"},"html":{"href":"https://github.com/scipy/scipy/pull/5554#discussion_r46081733"},"pull_request":{"href":"https://api.github.com/repos/scipy/scipy/pulls/5554"}}},"pull_request":{"url":"https://api.github.com/repos/scipy/scipy/pulls/5554","id":52041856,"html_url":"https://github.com/scipy/scipy/pull/5554","diff_url":"https://github.com/scipy/scipy/pull/5554.diff","patch_url":"https://github.com/scipy/scipy/pull/5554.patch","issue_url":"https://api.github.com/repos/scipy/scipy/issues/5554","number":5554,"state":"open","locked":false,"title":"MAINT/BUG: closes overflow bug in stats.tiecorrect","user":{"login":"behzadnouri","id":1288998,"avatar_url":"https://avatars.githubusercontent.com/u/1288998?v=3","gravatar_id":"","url":"https://api.github.com/users/behzadnouri","html_url":"https://github.com/behzadnouri","followers_url":"https://api.github.com/users/behzadnouri/followers","following_url":"https://api.github.com/users/behzadnouri/following{/other_user}","gists_url":"https://api.github.com/users/behzadnouri/gists{/gist_id}","starred_url":"https://api.github.com/users/behzadnouri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behzadnouri/subscriptions","organizations_url":"https://api.github.com/users/behzadnouri/orgs","repos_url":"https://api.github.com/users/behzadnouri/repos","events_url":"https://api.github.com/users/behzadnouri/events{/privacy}","received_events_url":"https://api.github.com/users/behzadnouri/received_events","type":"User","site_admin":false},"body":"closes https://github.com/scipy/scipy/issues/5553\r\n\r\nalso, removes the cython code","created_at":"2015-11-28T14:51:45Z","updated_at":"2015-11-28T16:42:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5577425913a053941ab75dad111dba1cdb0ba25f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scipy/scipy/pulls/5554/commits","review_comments_url":"https://api.github.com/repos/scipy/scipy/pulls/5554/comments","review_comment_url":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/5554/comments","statuses_url":"https://api.github.com/repos/scipy/scipy/statuses/8b0625708fa8fa54405ca37f5f93c02fa0a01b06","head":{"label":"behzadnouri:tie-corr","ref":"tie-corr","sha":"8b0625708fa8fa54405ca37f5f93c02fa0a01b06","user":{"login":"behzadnouri","id":1288998,"avatar_url":"https://avatars.githubusercontent.com/u/1288998?v=3","gravatar_id":"","url":"https://api.github.com/users/behzadnouri","html_url":"https://github.com/behzadnouri","followers_url":"https://api.github.com/users/behzadnouri/followers","following_url":"https://api.github.com/users/behzadnouri/following{/other_user}","gists_url":"https://api.github.com/users/behzadnouri/gists{/gist_id}","starred_url":"https://api.github.com/users/behzadnouri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behzadnouri/subscriptions","organizations_url":"https://api.github.com/users/behzadnouri/orgs","repos_url":"https://api.github.com/users/behzadnouri/repos","events_url":"https://api.github.com/users/behzadnouri/events{/privacy}","received_events_url":"https://api.github.com/users/behzadnouri/received_events","type":"User","site_admin":false},"repo":{"id":24436317,"name":"scipy","full_name":"behzadnouri/scipy","owner":{"login":"behzadnouri","id":1288998,"avatar_url":"https://avatars.githubusercontent.com/u/1288998?v=3","gravatar_id":"","url":"https://api.github.com/users/behzadnouri","html_url":"https://github.com/behzadnouri","followers_url":"https://api.github.com/users/behzadnouri/followers","following_url":"https://api.github.com/users/behzadnouri/following{/other_user}","gists_url":"https://api.github.com/users/behzadnouri/gists{/gist_id}","starred_url":"https://api.github.com/users/behzadnouri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behzadnouri/subscriptions","organizations_url":"https://api.github.com/users/behzadnouri/orgs","repos_url":"https://api.github.com/users/behzadnouri/repos","events_url":"https://api.github.com/users/behzadnouri/events{/privacy}","received_events_url":"https://api.github.com/users/behzadnouri/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/behzadnouri/scipy","description":"Scipy library main repository","fork":true,"url":"https://api.github.com/repos/behzadnouri/scipy","forks_url":"https://api.github.com/repos/behzadnouri/scipy/forks","keys_url":"https://api.github.com/repos/behzadnouri/scipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/behzadnouri/scipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/behzadnouri/scipy/teams","hooks_url":"https://api.github.com/repos/behzadnouri/scipy/hooks","issue_events_url":"https://api.github.com/repos/behzadnouri/scipy/issues/events{/number}","events_url":"https://api.github.com/repos/behzadnouri/scipy/events","assignees_url":"https://api.github.com/repos/behzadnouri/scipy/assignees{/user}","branches_url":"https://api.github.com/repos/behzadnouri/scipy/branches{/branch}","tags_url":"https://api.github.com/repos/behzadnouri/scipy/tags","blobs_url":"https://api.github.com/repos/behzadnouri/scipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/behzadnouri/scipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/behzadnouri/scipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/behzadnouri/scipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/behzadnouri/scipy/statuses/{sha}","languages_url":"https://api.github.com/repos/behzadnouri/scipy/languages","stargazers_url":"https://api.github.com/repos/behzadnouri/scipy/stargazers","contributors_url":"https://api.github.com/repos/behzadnouri/scipy/contributors","subscribers_url":"https://api.github.com/repos/behzadnouri/scipy/subscribers","subscription_url":"https://api.github.com/repos/behzadnouri/scipy/subscription","commits_url":"https://api.github.com/repos/behzadnouri/scipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/behzadnouri/scipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/behzadnouri/scipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/behzadnouri/scipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/behzadnouri/scipy/contents/{+path}","compare_url":"https://api.github.com/repos/behzadnouri/scipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/behzadnouri/scipy/merges","archive_url":"https://api.github.com/repos/behzadnouri/scipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/behzadnouri/scipy/downloads","issues_url":"https://api.github.com/repos/behzadnouri/scipy/issues{/number}","pulls_url":"https://api.github.com/repos/behzadnouri/scipy/pulls{/number}","milestones_url":"https://api.github.com/repos/behzadnouri/scipy/milestones{/number}","notifications_url":"https://api.github.com/repos/behzadnouri/scipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/behzadnouri/scipy/labels{/name}","releases_url":"https://api.github.com/repos/behzadnouri/scipy/releases{/id}","created_at":"2014-09-24T23:28:37Z","updated_at":"2015-05-08T11:44:42Z","pushed_at":"2015-11-28T15:54:16Z","git_url":"git://github.com/behzadnouri/scipy.git","ssh_url":"git@github.com:behzadnouri/scipy.git","clone_url":"https://github.com/behzadnouri/scipy.git","svn_url":"https://github.com/behzadnouri/scipy","homepage":"http://scipy.org/scipylib/","size":59013,"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":"b60f38bda7db007e72937e17f64be10e25977168","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-28T12:16:27Z","pushed_at":"2015-11-28T15:00:16Z","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":68682,"stargazers_count":1961,"watchers_count":1961,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1119,"mirror_url":null,"open_issues_count":912,"forks":1119,"open_issues":912,"watchers":1961,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/5554"},"html":{"href":"https://github.com/scipy/scipy/pull/5554"},"issue":{"href":"https://api.github.com/repos/scipy/scipy/issues/5554"},"comments":{"href":"https://api.github.com/repos/scipy/scipy/issues/5554/comments"},"review_comments":{"href":"https://api.github.com/repos/scipy/scipy/pulls/5554/comments"},"review_comment":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scipy/scipy/pulls/5554/commits"},"statuses":{"href":"https://api.github.com/repos/scipy/scipy/statuses/8b0625708fa8fa54405ca37f5f93c02fa0a01b06"}}}}