Skip to content

Commit

Permalink
fix deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
akeaswaran committed Jun 23, 2024
1 parent 62b2c29 commit f6a610d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version="0.0.36.2.9",
version="0.0.36.2.10",
description="Retrieve Sports data in Python",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
18 changes: 9 additions & 9 deletions sportsdataverse/cfb/cfb_pbp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4708,29 +4708,29 @@ def __process_qbr(self, play_df):
)

play_df["sack_epa"] = np.where(
play_df["non_fumble_sack"] == True, play_df["qbr_epa"], np.NaN
play_df["non_fumble_sack"] == True, play_df["qbr_epa"], np.nan
)
play_df["pass_epa"] = np.where(
play_df["pass"] == True, play_df["qbr_epa"], np.NaN
play_df["pass"] == True, play_df["qbr_epa"], np.nan
)
play_df["rush_epa"] = np.where(
play_df["rush"] == True, play_df["qbr_epa"], np.NaN
play_df["rush"] == True, play_df["qbr_epa"], np.nan
)
play_df["pen_epa"] = np.where(
play_df["penalty_flag"] == True, play_df["qbr_epa"], np.NaN
play_df["penalty_flag"] == True, play_df["qbr_epa"], np.nan
)

play_df["sack_weight"] = np.where(
play_df["non_fumble_sack"] == True, play_df["weight"], np.NaN
play_df["non_fumble_sack"] == True, play_df["weight"], np.nan
)
play_df["pass_weight"] = np.where(
play_df["pass"] == True, play_df["weight"], np.NaN
play_df["pass"] == True, play_df["weight"], np.nan
)
play_df["rush_weight"] = np.where(
play_df["rush"] == True, play_df["weight"], np.NaN
play_df["rush"] == True, play_df["weight"], np.nan
)
play_df["pen_weight"] = np.where(
play_df["penalty_flag"] == True, play_df["weight"], np.NaN
play_df["penalty_flag"] == True, play_df["weight"], np.nan
)

play_df["action_play"] = play_df.EPA != 0
Expand Down Expand Up @@ -5041,7 +5041,7 @@ def __cast_box_score_column(self, column, target_type):
if (column in self.plays_json.columns):
self.plays_json[column] = self.plays_json[column].astype(target_type)
else:
self.plays_json[column] = np.NaN
self.plays_json[column] = np.nan

def create_box_score(self):
# have to run the pipeline before pulling this in
Expand Down
16 changes: 8 additions & 8 deletions sportsdataverse/nfl/nfl_pbp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4569,29 +4569,29 @@ def __process_qbr(self, play_df):
)

play_df["sack_epa"] = np.where(
play_df["non_fumble_sack"] == True, play_df["qbr_epa"], np.NaN
play_df["non_fumble_sack"] == True, play_df["qbr_epa"], np.nan
)
play_df["pass_epa"] = np.where(
play_df["pass"] == True, play_df["qbr_epa"], np.NaN
play_df["pass"] == True, play_df["qbr_epa"], np.nan
)
play_df["rush_epa"] = np.where(
play_df["rush"] == True, play_df["qbr_epa"], np.NaN
play_df["rush"] == True, play_df["qbr_epa"], np.nan
)
play_df["pen_epa"] = np.where(
play_df["penalty_flag"] == True, play_df["qbr_epa"], np.NaN
play_df["penalty_flag"] == True, play_df["qbr_epa"], np.nan
)

play_df["sack_weight"] = np.where(
play_df["non_fumble_sack"] == True, play_df["weight"], np.NaN
play_df["non_fumble_sack"] == True, play_df["weight"], np.nan
)
play_df["pass_weight"] = np.where(
play_df["pass"] == True, play_df["weight"], np.NaN
play_df["pass"] == True, play_df["weight"], np.nan
)
play_df["rush_weight"] = np.where(
play_df["rush"] == True, play_df["weight"], np.NaN
play_df["rush"] == True, play_df["weight"], np.nan
)
play_df["pen_weight"] = np.where(
play_df["penalty_flag"] == True, play_df["weight"], np.NaN
play_df["penalty_flag"] == True, play_df["weight"], np.nan
)

play_df["action_play"] = play_df.EPA != 0
Expand Down

0 comments on commit f6a610d

Please sign in to comment.