{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/10780","labels_url":"https://api.github.com/repos/pydata/pandas/issues/10780/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/10780/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/10780/events","html_url":"https://github.com/pydata/pandas/issues/10780","id":99983042,"number":10780,"title":"grouped.filter with dropna option","user":{"login":"leo4183","id":10853125,"avatar_url":"https://avatars.githubusercontent.com/u/10853125?v=3","gravatar_id":"","url":"https://api.github.com/users/leo4183","html_url":"https://github.com/leo4183","followers_url":"https://api.github.com/users/leo4183/followers","following_url":"https://api.github.com/users/leo4183/following{/other_user}","gists_url":"https://api.github.com/users/leo4183/gists{/gist_id}","starred_url":"https://api.github.com/users/leo4183/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leo4183/subscriptions","organizations_url":"https://api.github.com/users/leo4183/orgs","repos_url":"https://api.github.com/users/leo4183/repos","events_url":"https://api.github.com/users/leo4183/events{/privacy}","received_events_url":"https://api.github.com/users/leo4183/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-10T06:15:26Z","updated_at":"2015-08-10T10:41:46Z","closed_at":null,"body":"in Pandas 0.16.2:\r\n\r\n    grouped = a.groupby(idx)\r\n    grouped.filter(lambda x: x.mean()>0.0, dropna=False)\r\n\r\nin case there was no group whose `x.mean()` was larger than zero, an `AttributeError: 'list' object has no attribute 'astype'` would be raised (rather than returning an all `NaN` dataframe/serie in previous versions)."},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/129403887","html_url":"https://github.com/pydata/pandas/issues/10780#issuecomment-129403887","issue_url":"https://api.github.com/repos/pydata/pandas/issues/10780","id":129403887,"user":{"login":"leo4183","id":10853125,"avatar_url":"https://avatars.githubusercontent.com/u/10853125?v=3","gravatar_id":"","url":"https://api.github.com/users/leo4183","html_url":"https://github.com/leo4183","followers_url":"https://api.github.com/users/leo4183/followers","following_url":"https://api.github.com/users/leo4183/following{/other_user}","gists_url":"https://api.github.com/users/leo4183/gists{/gist_id}","starred_url":"https://api.github.com/users/leo4183/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leo4183/subscriptions","organizations_url":"https://api.github.com/users/leo4183/orgs","repos_url":"https://api.github.com/users/leo4183/repos","events_url":"https://api.github.com/users/leo4183/events{/privacy}","received_events_url":"https://api.github.com/users/leo4183/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T10:41:46Z","updated_at":"2015-08-10T10:41:46Z","body":"a concrete example:\r\n\r\n    row = 9\r\n    a   = pd.Series(np.random.rand(row),index=np.repeat([1,2,3],3))\r\n    gp  = a.groupby(level=0)\r\n    empty_serie  = gp.filter(lambda x: x.mean()>1)\r\n    error_raised = gp.filter(lambda x: x.mean()>1, dropna=False)\r\n\r\nwhere `empty_list` would be an empty serie, meanwhile attribute error would be raised for the last line "}}