Skip to content

Commit

Permalink
numpy upgrade fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamar Grey committed Feb 6, 2024
1 parent 132189b commit a62318e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def time_since_previous_false(datetime_col, bool_col):
df.loc[not_false_indices, "last_false_datetime"] = np.nan
df["last_false_datetime"] = df["last_false_datetime"].fillna(method="ffill")
total_seconds = (
df["datetime"] - df["last_false_datetime"]
pd.to_datetime(df["datetime"]).subtract(df["last_false_datetime"])
).dt.total_seconds()
return pd.Series(total_seconds)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def time_since_previous_true(datetime_col, bool_col):
df.loc[~not_false_indices, "last_true_datetime"] = np.nan
df["last_true_datetime"] = df["last_true_datetime"].fillna(method="ffill")
total_seconds = (
df["datetime"] - df["last_true_datetime"]
pd.to_datetime(df["datetime"]).subtract(df["last_true_datetime"])
).dt.total_seconds()
return pd.Series(total_seconds)

Expand Down

0 comments on commit a62318e

Please sign in to comment.