Skip to content

Chapter 6 uses deprecated append on Pandas dataframe #10

@gvwilson

Description

@gvwilson

Line 20-24 of Chapter-6/app.py is currently:

df = (
    df.append({"Year": MIN_YR - 1}, ignore_index=True)
    .sort_values("Year", ignore_index=True)
    .fillna(0)
)

but df.append is not available in Pandas 2.2.2. This code works with that version of Pandas:

df = (
    pd.concat([df, pd.DataFrame([{"Year": MIN_YR - 1}])], ignore_index=True)
    .sort_values("Year", ignore_index=True)
    .fillna(0)
)

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