Skip to content

pandas deprecation warning in make_results #667

Description

@jack89roberts
AIrsenal/airsenal/scripts/make_results.py:41: FutureWarning:
A value is trying to be set on a copy of a DataFrame or Series through chained
assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work
because the intermediate object on which we are setting values always behaves
as a copy.
fixtures_df["home_team"].replace(teams, inplace=True)


AIrsenal/airsenal/scripts/scrape_transfermarkt.py:118: FutureWarning:
Downcasting behavior in `replace` is deprecated and will be removed in a future version.
To retain the old behavior, explicitly call `result.infer_objects(copy=False)`. To opt-in to
the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
  df = df.replace({"-": np.nan, f"? {days_name}": np.nan, "?": np.nan})

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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