{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/9346","labels_url":"https://api.github.com/repos/pydata/pandas/issues/9346/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/9346/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/9346/events","html_url":"https://github.com/pydata/pandas/issues/9346","id":55331745,"number":9346,"title":"DOC/TST: is pd.unique and the order it returns API?","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},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/Docs","name":"Docs","color":"3465A4"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-23T20:57:00Z","updated_at":"2015-01-23T21:49:44Z","closed_at":null,"body":"Looking at the API docs, neither the function `pd.unique` nor the order of the unique values from `unique` is mentioned. I would like to:\r\n\r\n1. Add `pd.unique` to API > General functions > Data manipulations\r\n2. Note that `Series.unique()` and `unique()` return values in order of appearance\r\n3. Add unit tests to verify the \"order of appearance\" nature `unique` (untested directly AFAICT, though I'm sure it's relied on implicitly)\r\n\r\nAny objections? If not, I'll put together a PR.\r\n\r\nThis lack of documentation has caused some hesitation for relying on this functionality in Seaborn: https://github.com/mwaskom/seaborn/issues/361"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/71272341","html_url":"https://github.com/pydata/pandas/issues/9346#issuecomment-71272341","issue_url":"https://api.github.com/repos/pydata/pandas/issues/9346","id":71272341,"user":{"login":"JanSchulz","id":890156,"avatar_url":"https://avatars.githubusercontent.com/u/890156?v=3","gravatar_id":"","url":"https://api.github.com/users/JanSchulz","html_url":"https://github.com/JanSchulz","followers_url":"https://api.github.com/users/JanSchulz/followers","following_url":"https://api.github.com/users/JanSchulz/following{/other_user}","gists_url":"https://api.github.com/users/JanSchulz/gists{/gist_id}","starred_url":"https://api.github.com/users/JanSchulz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanSchulz/subscriptions","organizations_url":"https://api.github.com/users/JanSchulz/orgs","repos_url":"https://api.github.com/users/JanSchulz/repos","events_url":"https://api.github.com/users/JanSchulz/events{/privacy}","received_events_url":"https://api.github.com/users/JanSchulz/received_events","type":"User","site_admin":false},"created_at":"2015-01-23T21:49:44Z","updated_at":"2015-01-23T21:49:44Z","body":"I would like to suggest that `Series.unique()` is changed to the same \"API\" as `np.unique()`, e.g. that the result is sorted.\r\n\r\nNumpy actually specifies that the returned values are sorted: http://docs.scipy.org/doc/numpy/reference/generated/numpy.unique.html\r\n\r\n> Returns the sorted unique elements of an array. [...]"}}