From fa1b85d40455edcde77fba2b9bf7fd5861663eb3 Mon Sep 17 00:00:00 2001 From: Sophie Allen Date: Mon, 18 May 2026 10:16:42 -0700 Subject: [PATCH] Avoid inplace replace on Attendance Series --- pybaseball/team_results.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pybaseball/team_results.py b/pybaseball/team_results.py index 6e7c44ce..15fccb22 100644 --- a/pybaseball/team_results.py +++ b/pybaseball/team_results.py @@ -72,7 +72,7 @@ def get_table(soup: BeautifulSoup, team: str) -> pd.DataFrame: df = df.rename(columns=df.iloc[0]) df = df.reindex(df.index.drop(0)) df = df.drop('', axis=1) #not a useful column - df['Attendance'].replace(r'^Unknown$', np.nan, regex=True, inplace = True) # make this a NaN so the column can benumeric + df['Attendance'] = df['Attendance'].replace(r'^Unknown$', np.nan, regex=True) # make this a NaN so the column can benumeric return df def process_win_streak(data: pd.DataFrame) -> pd.DataFrame: