Skip to content

Commit

Permalink
Dont replicate nans in time (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulf81 authored Oct 21, 2024
1 parent dd404c6 commit 44e9bde
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions flasc/utilities/tuner_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ def replicate_nan_values(
# Identify common columns between df_1 and df_2
common_columns = df_1.columns.intersection(df_2.columns)

# Remove the time column from the common columns if included
common_columns.drop("time", errors="ignore")

# Use assign to create a new DataFrame with NaN values replaced
df_2_updated = df_2.assign(
**{col: np.where(df_1[col].isna(), np.nan, df_2[col]) for col in common_columns}
Expand Down

0 comments on commit 44e9bde

Please sign in to comment.