diff --git a/src/data/parse_mat.py b/src/data/parse_mat.py index 437a29b..f1ed72b 100644 --- a/src/data/parse_mat.py +++ b/src/data/parse_mat.py @@ -68,7 +68,7 @@ def parse_crest_toes(df_raw_features, df_profiles): # Try get the value from the other profile if we return nan or empty dataframe df_z = df_profile.loc[idx[site_id, param, x_val], :] - if df_z.empty: + if np.isnan(df_z.z): if param == "prestorm": new_param = "poststorm" elif param == "poststorm": @@ -77,16 +77,6 @@ def parse_crest_toes(df_raw_features, df_profiles): else: z_val = df_z.z - # # Try get the value from the other profile if we return nan or empty dataframe - # if df_profile.query(query).empty: - # if param == "prestorm": - # query = query.replace('prestorm', 'poststorm') - # elif param == "poststorm": - # query = query.replace('poststorm', 'prestorm') - # z_val = df_profile.query(query).iloc[0].z - # else: - # z_val = df_profile.query(query).iloc[0].z - # Put results back into merged dataframe df_crest_toes.loc[(site_id, param), "dune_{}_z".format(loc)] = z_val