Skip to content

Deprecation warnings with pandas 3.1 (inplace, read_csv(float_precision=...)) #570

Open

Description

@dweindl

pandas 3.1.0 deprecates the inplace keyword of drop, rename, reset_index, set_index, sort_index, sort_values and others (PDEP-8), and the float_precision argument of read_csv. Both emit Pandas4Warning (a DeprecationWarning subclass) and will stop working in pandas 4.

petab uses both when loading any PEtab table, so every Problem.from_yaml warns. Downstream test suites that turn warnings into errors fail (e.g., AMICI, see AMICI-dev/AMICI#3440).

Affected places on main (68be6d1):

  • read_csv(..., float_precision="round_trip"): v1/conditions.py, v1/core.py (2×), v1/mapping.py, v1/measurements.py, v1/observables.py, v1/parameters.py, v2/conditions.py, v2/experiments.py
  • reset_index(inplace=True) / set_index(..., inplace=True): v1/conditions.py, v1/mapping.py, v1/observables.py, v1/parameters.py (incl. l. 243), v1/simplify.py
  • sort_index(inplace=True): v1/visualize/plotting.py (2×)
  • rename(..., inplace=True) / drop(..., inplace=True): v2/petab1to2.py (5×)

(fillna(..., inplace=True) in v1/visualize/lint.py and v2/petab1to2.py is not affected.)

The inplace uses can be replaced by re-assignments. For float_precision, pandas 3.1 uses the same (improved) converter for all precision modes (pandas#64395), but older pandas versions don't parse round-trip by default. So the argument should probably only be passed for pandas < 3.1.

🤖 Generated with Claude Code

Activity

  1. self-assigned this
    on Oct 22, 2026
  2. added 3 commits that reference this issue on Oct 22, 2026
    79caffb
    0b22e8c
    57bb0dc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions