Skip to content

pandas FutureWarning: Series.__setitem__ treating keys as labelsΒ #1354

@atharvajoshi01

Description

@atharvajoshi01

Several places in the codebase use integer-based indexing on Series via __setitem__ (e.g., series[i] = value) instead of .iloc[i]. With recent pandas versions this triggers FutureWarnings and will break in pandas 3.0 when integer keys are always treated as labels.

This is the same class of bug that ta library fixed in their PSARIndicator (bukosabino/ta#361).

Spotted while reviewing PR #1346. Happy to put together a PR if you want β€” would just need to grep for __setitem__ patterns on Series objects and replace with .iloc[] where the intent is positional.

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