{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/3942","labels_url":"https://api.github.com/repos/pydata/pandas/issues/3942/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/3942/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/3942/events","html_url":"https://github.com/pydata/pandas/issues/3942","id":15675143,"number":3942,"title":"Add key to sorting functions","user":{"login":"hayd","id":1931852,"avatar_url":"https://avatars.githubusercontent.com/u/1931852?v=3","gravatar_id":"","url":"https://api.github.com/users/hayd","html_url":"https://github.com/hayd","followers_url":"https://api.github.com/users/hayd/followers","following_url":"https://api.github.com/users/hayd/following{/other_user}","gists_url":"https://api.github.com/users/hayd/gists{/gist_id}","starred_url":"https://api.github.com/users/hayd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hayd/subscriptions","organizations_url":"https://api.github.com/users/hayd/orgs","repos_url":"https://api.github.com/users/hayd/repos","events_url":"https://api.github.com/users/hayd/events{/privacy}","received_events_url":"https://api.github.com/users/hayd/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/Algos","name":"Algos","color":"eb6420"},{"url":"https://api.github.com/repos/pydata/pandas/labels/API%20Design","name":"API Design","color":"AD7FA8"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Enhancement","name":"Enhancement","color":"4E9A06"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/pydata/pandas/milestones/32","html_url":"https://github.com/pydata/pandas/milestones/Next%20Major%20Release","labels_url":"https://api.github.com/repos/pydata/pandas/milestones/32/labels","id":933188,"number":32,"title":"Next Major Release","description":"after 0.16.1 of course","creator":{"login":"jreback","id":953992,"avatar_url":"https://avatars.githubusercontent.com/u/953992?v=3","gravatar_id":"","url":"https://api.github.com/users/jreback","html_url":"https://github.com/jreback","followers_url":"https://api.github.com/users/jreback/followers","following_url":"https://api.github.com/users/jreback/following{/other_user}","gists_url":"https://api.github.com/users/jreback/gists{/gist_id}","starred_url":"https://api.github.com/users/jreback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreback/subscriptions","organizations_url":"https://api.github.com/users/jreback/orgs","repos_url":"https://api.github.com/users/jreback/repos","events_url":"https://api.github.com/users/jreback/events{/privacy}","received_events_url":"https://api.github.com/users/jreback/received_events","type":"User","site_admin":false},"open_issues":808,"closed_issues":12,"state":"open","created_at":"2015-01-13T10:53:19Z","updated_at":"2015-04-11T18:29:13Z","due_on":"2015-06-30T04:00:00Z","closed_at":null},"comments":7,"created_at":"2013-06-18T08:30:02Z","updated_at":"2015-04-11T20:19:15Z","closed_at":null,"body":"Many python functions  (sorting, max/min) accept a key argument, perhaps they could in pandas too.\r\n\r\n.\r\n\r\n*The terrible motivating example was this awful hack from [this question](http://stackoverflow.com/a/17157110/1240268).... for which maybe one could do*\r\n\r\n    df.sort_index(key=lambda t: literal_eval(t[1:-1]))\r\n\r\n*This would still be an awful awful hack, but a slightly less awful one*."},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/91921242","html_url":"https://github.com/pydata/pandas/issues/3942#issuecomment-91921242","issue_url":"https://api.github.com/repos/pydata/pandas/issues/3942","id":91921242,"user":{"login":"SethMMorton","id":1596189,"avatar_url":"https://avatars.githubusercontent.com/u/1596189?v=3","gravatar_id":"","url":"https://api.github.com/users/SethMMorton","html_url":"https://github.com/SethMMorton","followers_url":"https://api.github.com/users/SethMMorton/followers","following_url":"https://api.github.com/users/SethMMorton/following{/other_user}","gists_url":"https://api.github.com/users/SethMMorton/gists{/gist_id}","starred_url":"https://api.github.com/users/SethMMorton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SethMMorton/subscriptions","organizations_url":"https://api.github.com/users/SethMMorton/orgs","repos_url":"https://api.github.com/users/SethMMorton/repos","events_url":"https://api.github.com/users/SethMMorton/events{/privacy}","received_events_url":"https://api.github.com/users/SethMMorton/received_events","type":"User","site_admin":false},"created_at":"2015-04-11T20:19:15Z","updated_at":"2015-04-11T20:19:15Z","body":"Ok.  Thanks for your time.  I'll take a good, deep look at categoricals."}}