-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Pandas sort_values with multiple columns does not work for AffineScalarFunc #186
Comments
I thought #184 might help with this but after playing around with the |
When sorting a pandas dataframe by multiple columns and one of the columns contains values of type
AffineScalarFunc
, the sort failes due to missing__hash__
method.The
Variable
type implements a__hash__
method. Therfore it is possible to do it with this type:As soon as we start calculating, the dataframe no longer contains values of type
Variable
but of typeAffineScalarFunc
.Because of that, sorting multiple columns does no longer work:
To enable this functionality, 'AffineScalarFunc' must be hashable.
I think this would be possible by implementing something like this:
I think the derivative ids must be part of the hash to make the has dependent from the derivatives.
Additionally, I think that the nominal and linear part must also be part of the hash to ensure different hashes in case the uncertainty is multiplied with a regular float:
The text was updated successfully, but these errors were encountered: