{"action":"opened","number":14062,"pull_request":{"url":"https://api.github.com/repos/pydata/pandas/pulls/14062","id":82125412,"html_url":"https://github.com/pydata/pandas/pull/14062","diff_url":"https://github.com/pydata/pandas/pull/14062.diff","patch_url":"https://github.com/pydata/pandas/pull/14062.patch","issue_url":"https://api.github.com/repos/pydata/pandas/issues/14062","number":14062,"state":"open","locked":false,"title":"WIP: add sort_levels to MultiIndex.from_product","user":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"body":"Currently, `from_product` always sorts levels in the resulting MultiIndex. This means that the result does not necessarily have lexsorted labels/codes.\r\n\r\nThis PR adds an option to not sort levels when calling `from_product`. Using this option yields a few benefits:\r\n\r\n1. It's simpler -- resulting levels on the MultiIndex are exactly those you passed in.\r\n2. It's marginally faster -- you don't need to sort the levels.\r\n3. The resulting MultiIndex is always lex-sorted. This is handy if you want to be able to index it effeciently.\r\n\r\nThe downside is that the result can be a little less intuitive, because levels and labels do not have the same sort order (#14015).\r\n\r\nI'm suggesting this option because it would be useful for xarray (to fix https://github.com/pydata/xarray/issues/980) -- otherwise we would simply put it in our own utility function.\r\n\r\nI'm not certain that this is the best argument name, or that I've described it in a way that is clear if you don't understand MultiIndex internals.\r\n\r\n - [ ] tests added / passed\r\n - [ ] passes ``git diff upstream/master | flake8 --diff``\r\n - [ ] whatsnew entry\r\n\r\n","created_at":"2016-08-22T01:55:01Z","updated_at":"2016-08-22T01:55:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2aa6af9e0289b621bf7a9e559831dc830ee36378","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pydata/pandas/pulls/14062/commits","review_comments_url":"https://api.github.com/repos/pydata/pandas/pulls/14062/comments","review_comment_url":"https://api.github.com/repos/pydata/pandas/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/14062/comments","statuses_url":"https://api.github.com/repos/pydata/pandas/statuses/c25455c6059d553671d365d4cf9c21c47a975b43","head":{"label":"shoyer:from_product_sort_levels","ref":"from_product_sort_levels","sha":"c25455c6059d553671d365d4cf9c21c47a975b43","user":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"repo":{"id":16186481,"name":"pandas","full_name":"shoyer/pandas","owner":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shoyer/pandas","description":"Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more","fork":true,"url":"https://api.github.com/repos/shoyer/pandas","forks_url":"https://api.github.com/repos/shoyer/pandas/forks","keys_url":"https://api.github.com/repos/shoyer/pandas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shoyer/pandas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shoyer/pandas/teams","hooks_url":"https://api.github.com/repos/shoyer/pandas/hooks","issue_events_url":"https://api.github.com/repos/shoyer/pandas/issues/events{/number}","events_url":"https://api.github.com/repos/shoyer/pandas/events","assignees_url":"https://api.github.com/repos/shoyer/pandas/assignees{/user}","branches_url":"https://api.github.com/repos/shoyer/pandas/branches{/branch}","tags_url":"https://api.github.com/repos/shoyer/pandas/tags","blobs_url":"https://api.github.com/repos/shoyer/pandas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shoyer/pandas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shoyer/pandas/git/refs{/sha}","trees_url":"https://api.github.com/repos/shoyer/pandas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shoyer/pandas/statuses/{sha}","languages_url":"https://api.github.com/repos/shoyer/pandas/languages","stargazers_url":"https://api.github.com/repos/shoyer/pandas/stargazers","contributors_url":"https://api.github.com/repos/shoyer/pandas/contributors","subscribers_url":"https://api.github.com/repos/shoyer/pandas/subscribers","subscription_url":"https://api.github.com/repos/shoyer/pandas/subscription","commits_url":"https://api.github.com/repos/shoyer/pandas/commits{/sha}","git_commits_url":"https://api.github.com/repos/shoyer/pandas/git/commits{/sha}","comments_url":"https://api.github.com/repos/shoyer/pandas/comments{/number}","issue_comment_url":"https://api.github.com/repos/shoyer/pandas/issues/comments{/number}","contents_url":"https://api.github.com/repos/shoyer/pandas/contents/{+path}","compare_url":"https://api.github.com/repos/shoyer/pandas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shoyer/pandas/merges","archive_url":"https://api.github.com/repos/shoyer/pandas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shoyer/pandas/downloads","issues_url":"https://api.github.com/repos/shoyer/pandas/issues{/number}","pulls_url":"https://api.github.com/repos/shoyer/pandas/pulls{/number}","milestones_url":"https://api.github.com/repos/shoyer/pandas/milestones{/number}","notifications_url":"https://api.github.com/repos/shoyer/pandas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shoyer/pandas/labels{/name}","releases_url":"https://api.github.com/repos/shoyer/pandas/releases{/id}","deployments_url":"https://api.github.com/repos/shoyer/pandas/deployments","created_at":"2014-01-23T21:38:59Z","updated_at":"2015-04-03T17:24:43Z","pushed_at":"2016-08-22T01:21:40Z","git_url":"git://github.com/shoyer/pandas.git","ssh_url":"git@github.com:shoyer/pandas.git","clone_url":"https://github.com/shoyer/pandas.git","svn_url":"https://github.com/shoyer/pandas","homepage":"http://pandas.pydata.org","size":69661,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"pydata:master","ref":"master","sha":"df2d9ab917a1ef4732cfb6c3317432f60c071074","user":{"login":"pydata","id":1284191,"avatar_url":"https://avatars.githubusercontent.com/u/1284191?v=3","gravatar_id":"","url":"https://api.github.com/users/pydata","html_url":"https://github.com/pydata","followers_url":"https://api.github.com/users/pydata/followers","following_url":"https://api.github.com/users/pydata/following{/other_user}","gists_url":"https://api.github.com/users/pydata/gists{/gist_id}","starred_url":"https://api.github.com/users/pydata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydata/subscriptions","organizations_url":"https://api.github.com/users/pydata/orgs","repos_url":"https://api.github.com/users/pydata/repos","events_url":"https://api.github.com/users/pydata/events{/privacy}","received_events_url":"https://api.github.com/users/pydata/received_events","type":"Organization","site_admin":false},"repo":{"id":858127,"name":"pandas","full_name":"pydata/pandas","owner":{"login":"pydata","id":1284191,"avatar_url":"https://avatars.githubusercontent.com/u/1284191?v=3","gravatar_id":"","url":"https://api.github.com/users/pydata","html_url":"https://github.com/pydata","followers_url":"https://api.github.com/users/pydata/followers","following_url":"https://api.github.com/users/pydata/following{/other_user}","gists_url":"https://api.github.com/users/pydata/gists{/gist_id}","starred_url":"https://api.github.com/users/pydata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydata/subscriptions","organizations_url":"https://api.github.com/users/pydata/orgs","repos_url":"https://api.github.com/users/pydata/repos","events_url":"https://api.github.com/users/pydata/events{/privacy}","received_events_url":"https://api.github.com/users/pydata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pydata/pandas","description":"Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more","fork":false,"url":"https://api.github.com/repos/pydata/pandas","forks_url":"https://api.github.com/repos/pydata/pandas/forks","keys_url":"https://api.github.com/repos/pydata/pandas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pydata/pandas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pydata/pandas/teams","hooks_url":"https://api.github.com/repos/pydata/pandas/hooks","issue_events_url":"https://api.github.com/repos/pydata/pandas/issues/events{/number}","events_url":"https://api.github.com/repos/pydata/pandas/events","assignees_url":"https://api.github.com/repos/pydata/pandas/assignees{/user}","branches_url":"https://api.github.com/repos/pydata/pandas/branches{/branch}","tags_url":"https://api.github.com/repos/pydata/pandas/tags","blobs_url":"https://api.github.com/repos/pydata/pandas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pydata/pandas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pydata/pandas/git/refs{/sha}","trees_url":"https://api.github.com/repos/pydata/pandas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pydata/pandas/statuses/{sha}","languages_url":"https://api.github.com/repos/pydata/pandas/languages","stargazers_url":"https://api.github.com/repos/pydata/pandas/stargazers","contributors_url":"https://api.github.com/repos/pydata/pandas/contributors","subscribers_url":"https://api.github.com/repos/pydata/pandas/subscribers","subscription_url":"https://api.github.com/repos/pydata/pandas/subscription","commits_url":"https://api.github.com/repos/pydata/pandas/commits{/sha}","git_commits_url":"https://api.github.com/repos/pydata/pandas/git/commits{/sha}","comments_url":"https://api.github.com/repos/pydata/pandas/comments{/number}","issue_comment_url":"https://api.github.com/repos/pydata/pandas/issues/comments{/number}","contents_url":"https://api.github.com/repos/pydata/pandas/contents/{+path}","compare_url":"https://api.github.com/repos/pydata/pandas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pydata/pandas/merges","archive_url":"https://api.github.com/repos/pydata/pandas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pydata/pandas/downloads","issues_url":"https://api.github.com/repos/pydata/pandas/issues{/number}","pulls_url":"https://api.github.com/repos/pydata/pandas/pulls{/number}","milestones_url":"https://api.github.com/repos/pydata/pandas/milestones{/number}","notifications_url":"https://api.github.com/repos/pydata/pandas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pydata/pandas/labels{/name}","releases_url":"https://api.github.com/repos/pydata/pandas/releases{/id}","deployments_url":"https://api.github.com/repos/pydata/pandas/deployments","created_at":"2010-08-24T01:37:33Z","updated_at":"2016-08-21T23:19:25Z","pushed_at":"2016-08-22T01:55:03Z","git_url":"git://github.com/pydata/pandas.git","ssh_url":"git@github.com:pydata/pandas.git","clone_url":"https://github.com/pydata/pandas.git","svn_url":"https://github.com/pydata/pandas","homepage":"http://pandas.pydata.org","size":150726,"stargazers_count":6883,"watchers_count":6883,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2848,"mirror_url":null,"open_issues_count":1829,"forks":2848,"open_issues":1829,"watchers":6883,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pydata/pandas/pulls/14062"},"html":{"href":"https://github.com/pydata/pandas/pull/14062"},"issue":{"href":"https://api.github.com/repos/pydata/pandas/issues/14062"},"comments":{"href":"https://api.github.com/repos/pydata/pandas/issues/14062/comments"},"review_comments":{"href":"https://api.github.com/repos/pydata/pandas/pulls/14062/comments"},"review_comment":{"href":"https://api.github.com/repos/pydata/pandas/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pydata/pandas/pulls/14062/commits"},"statuses":{"href":"https://api.github.com/repos/pydata/pandas/statuses/c25455c6059d553671d365d4cf9c21c47a975b43"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":16,"deletions":6,"changed_files":1}}
{"actor":{"display_login":"shoyer"}}