{"action":"created","issue":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/16509","repository_url":"https://api.github.com/repos/pandas-dev/pandas","labels_url":"https://api.github.com/repos/pandas-dev/pandas/issues/16509/labels{/name}","comments_url":"https://api.github.com/repos/pandas-dev/pandas/issues/16509/comments","events_url":"https://api.github.com/repos/pandas-dev/pandas/issues/16509/events","html_url":"https://github.com/pandas-dev/pandas/pull/16509","id":231474023,"number":16509,"title":"optimized median func when bottleneck not present","user":{"login":"rohanp","id":7104880,"avatar_url":"https://avatars1.githubusercontent.com/u/7104880?v=3","gravatar_id":"","url":"https://api.github.com/users/rohanp","html_url":"https://github.com/rohanp","followers_url":"https://api.github.com/users/rohanp/followers","following_url":"https://api.github.com/users/rohanp/following{/other_user}","gists_url":"https://api.github.com/users/rohanp/gists{/gist_id}","starred_url":"https://api.github.com/users/rohanp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohanp/subscriptions","organizations_url":"https://api.github.com/users/rohanp/orgs","repos_url":"https://api.github.com/users/rohanp/repos","events_url":"https://api.github.com/users/rohanp/events{/privacy}","received_events_url":"https://api.github.com/users/rohanp/received_events","type":"User","site_admin":false},"labels":[{"id":47223669,"url":"https://api.github.com/repos/pandas-dev/pandas/labels/Numeric","name":"Numeric","color":"006b75","default":false},{"id":8935311,"url":"https://api.github.com/repos/pandas-dev/pandas/labels/Performance","name":"Performance","color":"a10c02","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-05-25T22:10:38Z","updated_at":"2017-05-25T22:36:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pandas-dev/pandas/pulls/16509","html_url":"https://github.com/pandas-dev/pandas/pull/16509","diff_url":"https://github.com/pandas-dev/pandas/pull/16509.diff","patch_url":"https://github.com/pandas-dev/pandas/pull/16509.patch"},"body":"Uses np.nanmedian to compute median instead of internal algos.median when bottleneck is not present/turned off. Has order of magnitude performance benefits\r\n\r\n`df = pd.DataFrame(np.random.randn(10000, 2), columns=list('AB'))`\r\n\r\nBefore\r\n```\r\n>>> pd.set_option('use_bottleneck', False)\r\n>>> %timeit df.median(1)\r\n318 ms ± 8.56 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\r\n\r\n>>> %timeit pd.Series(np.nanmedian(df.values, axis=1), index=df.index)\r\n1.83 ms ± 123 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\r\n\r\n>>> pd.set_option('use_bottleneck', True)\r\n>>> %timeit df.median(1)\r\n239 µs ± 2.23 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\r\n```\r\n\r\nAfter\r\n```\r\n>>> pd.set_option('use_bottleneck', False)\r\n>>> %timeit df.median(1)\r\n1.89 ms ± 53.2 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\r\n\r\n>>> pd.set_option('use_bottleneck', True)\r\n>>> %timeit df.median(1)\r\n227 µs ± 11 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/comments/304143135","html_url":"https://github.com/pandas-dev/pandas/pull/16509#issuecomment-304143135","issue_url":"https://api.github.com/repos/pandas-dev/pandas/issues/16509","id":304143135,"user":{"login":"rohanp","id":7104880,"avatar_url":"https://avatars1.githubusercontent.com/u/7104880?v=3","gravatar_id":"","url":"https://api.github.com/users/rohanp","html_url":"https://github.com/rohanp","followers_url":"https://api.github.com/users/rohanp/followers","following_url":"https://api.github.com/users/rohanp/following{/other_user}","gists_url":"https://api.github.com/users/rohanp/gists{/gist_id}","starred_url":"https://api.github.com/users/rohanp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohanp/subscriptions","organizations_url":"https://api.github.com/users/rohanp/orgs","repos_url":"https://api.github.com/users/rohanp/repos","events_url":"https://api.github.com/users/rohanp/events{/privacy}","received_events_url":"https://api.github.com/users/rohanp/received_events","type":"User","site_admin":false},"created_at":"2017-05-25T22:36:49Z","updated_at":"2017-05-25T22:36:49Z","body":"Do i need to run all the tests or can i get away with a subset?"}}
{"actor":{"display_login":"rohanp"}}