Skip to content

Commit

Permalink
downgrade polars version
Browse files Browse the repository at this point in the history
  • Loading branch information
saiemgilani committed Sep 3, 2023
1 parent 7b681ce commit 8f757d3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sportsdataverse/cfb/cfb_pbp.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,13 +507,13 @@ def __helper_cfb_pbp_features(self, pbp_txt, init):
- pl.struct(["id", "period.number"]).apply(
lambda x: (
sum(
(i <= x.struct.field("id")) & (x.struct.field("period.number") <= 2)
(i <= x["id"]) & (x["period.number"] <= 2)
for i in pbp_txt["timeouts"][int(init["homeTeamId"])]["1"]
)
)
| (
sum(
(i <= x.struct.field("id")) & (x.struct.field("period.number") > 2)
(i <= x["id"]) & (x["period.number"] > 2)
for i in pbp_txt["timeouts"][int(init["homeTeamId"])]["2"]
)
),
Expand All @@ -525,13 +525,13 @@ def __helper_cfb_pbp_features(self, pbp_txt, init):
- pl.struct(["id", "period.number"]).apply(
lambda x: (
sum(
(i <= x.struct.field("id")) & (x.struct.field("period.number") <= 2)
(i <= x["id"]) & (x["period.number"] <= 2)
for i in pbp_txt["timeouts"][int(init["awayTeamId"])]["1"]
)
)
| (
sum(
(i <= x.struct.field("id")) & (x.struct.field("period.number") > 2)
(i <= x["id"]) & (x["period.number"] > 2)
for i in pbp_txt["timeouts"][int(init["awayTeamId"])]["2"]
)
),
Expand Down Expand Up @@ -2548,10 +2548,10 @@ def __add_player_cols(self, play_df):
)
.with_columns(
punt_block_return_player=pl.struct(["punt_block_player", "punt_block_return_player"]).apply(
lambda cols: cols.struct.field("punt_block_return_player")
lambda cols: cols["punt_block_return_player"]
.replace(r"(?i)(.+)blocked by", "")
.replace(str(pl.format(r"(?i)blocked by {}", cols.struct.field("punt_block_player"))), "")
if cols.struct.field("punt_block_return_player") is not None
.replace(str(pl.format(r"(?i)blocked by {}", cols["punt_block_player"])), "")
if cols["punt_block_return_player"] is not None
else None,
return_dtype=pl.Utf8,
)
Expand Down

1 comment on commit 8f757d3

@vercel
Copy link

@vercel vercel bot commented on 8f757d3 Sep 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.