← All recipes
Moderne licensed

Eliminate inplace=True in favor of reassignment

Recipe IDorg.openrewrite.python.cleanup.PandasAvoidInplaceArtifactopenrewrite-static-analysis

Convert pandas operations that use inplace=True into reassignment form, e.g. df.drop_duplicates(inplace=True) becomes df = df.drop_duplicates().

Single recipeProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.python.cleanup.PandasAvoidInplace

If the recipe isn’t available locally, install it with:

mod config recipes pip install openrewrite-static-analysis