{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/9927","labels_url":"https://api.github.com/repos/pydata/pandas/issues/9927/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/9927/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/9927/events","html_url":"https://github.com/pydata/pandas/issues/9927","id":69258884,"number":9927,"title":"API/BUG: awkward syntax to add categories to a Categorical","user":{"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},"labels":[{"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/Categorical","name":"Categorical","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/pydata/pandas/milestones/34","html_url":"https://github.com/pydata/pandas/milestones/0.17.0","labels_url":"https://api.github.com/repos/pydata/pandas/milestones/34/labels","id":1033710,"number":34,"title":"0.17.0","description":"","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":13,"closed_issues":0,"state":"open","created_at":"2015-03-23T10:47:38Z","updated_at":"2015-04-18T02:45:20Z","due_on":"2015-06-30T04:00:00Z","closed_at":null},"comments":1,"created_at":"2015-04-18T02:45:20Z","updated_at":"2015-04-18T02:45:28Z","closed_at":null,"body":"from [SO](http://stackoverflow.com/questions/29709918/pandas-and-category-replacement/29712287#29712287)\r\n\r\n- the ``.add_categories`` should be able to take an ``Index``/ndarray, ATM it must be converted to a list\r\n- should be a keyword for something like: add any additional categories that I am passing to you (even if the current ones are duplicates, just add these to the end). e.g.\r\n\r\n```\r\nIn [147]: s = pd.Categorical(list('aabbcd'))\r\n\r\nIn [148]: s2 = list('aabbcdefg')\r\n\r\nIn [149]: s\r\nOut[149]: \r\n[a, a, b, b, c, d]\r\nCategories (4, object): [a, b, c, d]\r\n\r\nIn [150]: s.add_categories(s.categories.sym_diff(Index(s2)).tolist())\r\nOut[150]: \r\n[a, a, b, b, c, d]\r\nCategories (7, object): [a, b, c, d, e, f, g]\r\n```\r\n\r\nI would ideally just like to say:\r\n\r\n```\r\ns.add_categories(s2, take_new=True)\r\n```\r\n\r\n(maybe not the best keyword, but something like this)"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/94119911","html_url":"https://github.com/pydata/pandas/issues/9927#issuecomment-94119911","issue_url":"https://api.github.com/repos/pydata/pandas/issues/9927","id":94119911,"user":{"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},"created_at":"2015-04-18T02:45:28Z","updated_at":"2015-04-18T02:45:28Z","body":"cc @JanSchulz"}}