flasc.utilities.tuner_utilities.replicate_nan_values

flasc.utilities.tuner_utilities.replicate_nan_values#

flasc.utilities.tuner_utilities.replicate_nan_values(df_1: DataFrame | FlascDataFrame, df_2: DataFrame | FlascDataFrame)[source]#

Replicate NaN Values in DataFrame df_2 to Match DataFrame df_1.

For columns that are common between df_1 and df_2, this function ensures that NaN values in df_2 appear in the same locations as NaN values in df_1. This is primarily useful when df_2 represents a FLORIS resimulation of df_1, and you want to ensure that missing data is consistent between the two DataFrames.

Parameters:
  • df_1 (pandas.DataFrame | FlascDataFrame) -- The reference DataFrame containing NaN values.

  • df_2 (pandas.DataFrame | FlascDataFrame) -- The DataFrame to be updated to match NaN positions in df_1.

Returns:

A new DataFrame with NaN values in df_2 replaced to match df_1.

Return type:

pandas.DataFrame