Groupby([]).sum() Miscalculation - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Data Science (https://python-forum.io/forum-44.html) +--- Thread: Groupby([]).sum() Miscalculation (/thread-21127.html) |
Groupby([]).sum() Miscalculation - mini_geek - Sep-15-2019 Hi all, this is my first post so please take it easy! The following code is dropping data: e.g. SEC figures is missing "1 Insurance/Annuity Products" should be 2 total and FDIC is missing "2 Residential Mortgage" line items; any ideas what may be wrong? Thanks! n = df1.groupby(['Year', 'State', 'Regulator', 'Industry','Product', 'Count']).sum() Output usingcode above: Correct values:
RE: Groupby([]).sum() Miscalculation - Larz60+ - Sep-16-2019 just about impossible to say what is wrong without support code. Please show enough code to support analysis. |