Skip to content

Commit

Permalink
Fixing pandas copy on slice warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Jday7879 committed May 17, 2024
1 parent f1372f0 commit f1abca8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/flag_and_count_matched_pairs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def flag_matched_pair_merge(
time_difference = -time_difference

# Creating new DF, shifting period for forward or backward
df_with_predictive_column = df[[reference, strata, target]]
df_with_predictive_column = df.copy()[[reference, strata, target]]
df_with_predictive_column["predictive_period"] = df[period] + pd.DateOffset(
months=time_difference
)
Expand Down

0 comments on commit f1abca8

Please sign in to comment.