Skip to content
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

calc_sobol() throws TypeError (seems related to Pandas >= 2.0) #72

Open
arodmor opened this issue Apr 8, 2024 · 0 comments
Open

calc_sobol() throws TypeError (seems related to Pandas >= 2.0) #72

arodmor opened this issue Apr 8, 2024 · 0 comments

Comments

@arodmor
Copy link

arodmor commented Apr 8, 2024

Dear Developers:

Hello, first I want to thank you for developing and maintaining this great package!

I've been following the various examples and models, and when running the Virus Spread model, I get an error when getting to the Sensitivity Analysis section of the notebook. In particular, the results.calc_sobol() cell throws a TypeError that seems related to a change that was made in Pandas 2.0.

My environment is Linux Mint 21.3 (Ubuntu jammy 22.04 LTS), I installed agentpy by following the repo instructions (pip install agentpy). Pandas version in my environment is 2.2.1.

This is the error (long traceback, it goes across 3 screenshots):

Screenshot-1
Screenshot-2
Screenshot-3

This seems related to issue #57031 in Pandas, which happens when upgrading Pandas to >= 2.0.

Will you please see if you can reproduce this error? If so, it'd probably have an easy fix, since the resolution for the mentioned issue in Pandas simply requires to call .mean(numeric_only=True) instead of just .mean(), as it's currently done in calc_sobol() in the DataDict class in datadict.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant