{"action":"created","issue":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/16337","repository_url":"https://api.github.com/repos/pandas-dev/pandas","labels_url":"https://api.github.com/repos/pandas-dev/pandas/issues/16337/labels{/name}","comments_url":"https://api.github.com/repos/pandas-dev/pandas/issues/16337/comments","events_url":"https://api.github.com/repos/pandas-dev/pandas/issues/16337/events","html_url":"https://github.com/pandas-dev/pandas/issues/16337","id":228217746,"node_id":"MDU6SXNzdWUyMjgyMTc3NDY=","number":16337,"title":"Query re Deprecation of groupby.agg() with a dictionary when renaming","user":{"login":"allen-q","id":20735355,"node_id":"MDQ6VXNlcjIwNzM1MzU1","avatar_url":"https://avatars1.githubusercontent.com/u/20735355?v=4","gravatar_id":"","url":"https://api.github.com/users/allen-q","html_url":"https://github.com/allen-q","followers_url":"https://api.github.com/users/allen-q/followers","following_url":"https://api.github.com/users/allen-q/following{/other_user}","gists_url":"https://api.github.com/users/allen-q/gists{/gist_id}","starred_url":"https://api.github.com/users/allen-q/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allen-q/subscriptions","organizations_url":"https://api.github.com/users/allen-q/orgs","repos_url":"https://api.github.com/users/allen-q/repos","events_url":"https://api.github.com/users/allen-q/events{/privacy}","received_events_url":"https://api.github.com/users/allen-q/received_events","type":"User","site_admin":false},"labels":[{"id":233160,"node_id":"MDU6TGFiZWwyMzMxNjA=","url":"https://api.github.com/repos/pandas-dev/pandas/labels/Groupby","name":"Groupby","color":"729FCF","default":false},{"id":34444536,"node_id":"MDU6TGFiZWwzNDQ0NDUzNg==","url":"https://api.github.com/repos/pandas-dev/pandas/labels/Usage%20Question","name":"Usage Question","color":"0052cc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/pandas-dev/pandas/milestones/33","html_url":"https://github.com/pandas-dev/pandas/milestone/33","labels_url":"https://api.github.com/repos/pandas-dev/pandas/milestones/33/labels","id":997544,"node_id":"MDk6TWlsZXN0b25lOTk3NTQ0","number":33,"title":"No action","description":"A milestone for closed or open issues for which there is no action needed (eg not a bug, just a question / discussion, nothing to resolve, wontfix, etc).\r\n\r\n","creator":{"login":"jorisvandenbossche","id":1020496,"node_id":"MDQ6VXNlcjEwMjA0OTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1020496?v=4","gravatar_id":"","url":"https://api.github.com/users/jorisvandenbossche","html_url":"https://github.com/jorisvandenbossche","followers_url":"https://api.github.com/users/jorisvandenbossche/followers","following_url":"https://api.github.com/users/jorisvandenbossche/following{/other_user}","gists_url":"https://api.github.com/users/jorisvandenbossche/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisvandenbossche/subscriptions","organizations_url":"https://api.github.com/users/jorisvandenbossche/orgs","repos_url":"https://api.github.com/users/jorisvandenbossche/repos","events_url":"https://api.github.com/users/jorisvandenbossche/events{/privacy}","received_events_url":"https://api.github.com/users/jorisvandenbossche/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":1691,"state":"open","created_at":"2015-02-26T19:29:05Z","updated_at":"2018-10-08T14:56:10Z","due_on":"2019-09-30T07:00:00Z","closed_at":null},"comments":5,"created_at":"2017-05-12T08:08:35Z","updated_at":"2018-10-09T17:18:03Z","closed_at":"2017-05-12T10:05:45Z","author_association":"NONE","body":"#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\n# Your code here\r\ndf = pd.DataFrame({'City':['LA', 'NYC', 'NYC', 'LA', 'Chicago', 'NYC'],\r\n       'isFraud':[1, 0, 0, 1, 0, 1]})\r\n\r\ndf.groupby(df['City'])['isFraud'].agg({'Fraud':sum, 'Non-Fraud': lambda x: len(x)-sum(x), 'Squared': lambda x: (sum(x))**2})\r\n```\r\n#### Problem description\r\n\r\nI just learnt using a dictionary for renaming in agg is going to be deprecated in the latest version. My question is what's the alternative to achieve the above, i.e. using multiple lambda functions within agg?\r\n#### Expected Output\r\n\r\n```\r\n         Non-Fraud  Fraud  Squared\r\nCity                              \r\nChicago          1      0        0\r\nLA               0      2        4\r\nNYC              2      1        1\r\n```\r\n\r\n#### Output of ``pd.show_versions()``\r\n\r\n<details>\r\n# Paste the output here pd.show_versions() here\r\n\r\n</details>\r\n"},"comment":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/comments/428276459","html_url":"https://github.com/pandas-dev/pandas/issues/16337#issuecomment-428276459","issue_url":"https://api.github.com/repos/pandas-dev/pandas/issues/16337","id":428276459,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODI3NjQ1OQ==","user":{"login":"GuiMarthe","id":16212855,"node_id":"MDQ6VXNlcjE2MjEyODU1","avatar_url":"https://avatars3.githubusercontent.com/u/16212855?v=4","gravatar_id":"","url":"https://api.github.com/users/GuiMarthe","html_url":"https://github.com/GuiMarthe","followers_url":"https://api.github.com/users/GuiMarthe/followers","following_url":"https://api.github.com/users/GuiMarthe/following{/other_user}","gists_url":"https://api.github.com/users/GuiMarthe/gists{/gist_id}","starred_url":"https://api.github.com/users/GuiMarthe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GuiMarthe/subscriptions","organizations_url":"https://api.github.com/users/GuiMarthe/orgs","repos_url":"https://api.github.com/users/GuiMarthe/repos","events_url":"https://api.github.com/users/GuiMarthe/events{/privacy}","received_events_url":"https://api.github.com/users/GuiMarthe/received_events","type":"User","site_admin":false},"created_at":"2018-10-09T17:18:03Z","updated_at":"2018-10-09T17:18:03Z","author_association":"NONE","body":"How is the deprecation status of the tuple naming method that @bridwell mentions?\r\nWill it continue to be supported?"}}
{"actor":{"display_login":"GuiMarthe"}}