Skip to content

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

@arodmor

Description

@arodmor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions