Skip to content

Commit b18fde8

Browse files
yasumorishimaclaude
andcommitted
Fix FutureWarning in team_results.py (#459)
Replace deprecated chained assignment with direct assignment to avoid FutureWarning in pandas 3.0. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e588989 commit b18fde8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pybaseball/team_results.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def get_table(soup: BeautifulSoup, team: str) -> pd.DataFrame:
7272
df = df.rename(columns=df.iloc[0])
7373
df = df.reindex(df.index.drop(0))
7474
df = df.drop('', axis=1) #not a useful column
75-
df['Attendance'].replace(r'^Unknown$', np.nan, regex=True, inplace = True) # make this a NaN so the column can benumeric
75+
df['Attendance'] = df['Attendance'].replace(r'^Unknown$', np.nan, regex=True) # make this a NaN so the column can be numeric
7676
return df
7777

7878
def process_win_streak(data: pd.DataFrame) -> pd.DataFrame:

0 commit comments

Comments
 (0)