-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
pivot_table passes junk to aggfunc when value column does not exist #10326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
it will exclude the not-found columns in the values, see here. This should probably raise an intelligeble message that this is not found (though not sure if there is relied upon elsewhere) |
I'm working on this now. Should we throw an error message saying some columns are missing and then terminate the process before calling the function specified in the 'aggfun' argument? In this way we won't rely on the final user to check if the results are what he/she was expecting. This is clearly an example of wrong arguments passed to the function after all. |
From SO: This will crash python for me (2.7 win64, master), may be related? @IamGianluca
|
@chris-b1 thanks for posting this in GitHub. It crashes also on python 3.4. I didn't have the time to fully investigate it, but I'll probably tomorrow. |
This is raising a more sensible error now. Guess this could use a test.
|
Expected behavior is that pivot_table would throw an exception explaining the missing column. Instead pivot_table passes DataFrames to aggfunc before checking.
Example:
gives, as expected:
But the following throws an Exception from agg, rather than an exception from pivot_table about the missing value column:
The text was updated successfully, but these errors were encountered: