From f21a6b31c37a1392af4b2f82dc08db2444054f3d Mon Sep 17 00:00:00 2001 From: Dan Howe Date: Mon, 9 May 2022 14:14:42 +0200 Subject: [PATCH] Make sure all blocks are str --- probabilistic-analysis/probabilistic_assessment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/probabilistic-analysis/probabilistic_assessment.py b/probabilistic-analysis/probabilistic_assessment.py index 38cc0df..60fcd0a 100644 --- a/probabilistic-analysis/probabilistic_assessment.py +++ b/probabilistic-analysis/probabilistic_assessment.py @@ -472,6 +472,7 @@ def process(beach_name, beach_scenario, n_runs, start_year, end_year, # Create output dataframe df_out = df_in[['beach', 'block', 'profile']] + df_out['block'] = df_out['block'].astype(str) # Add info on non-erodable sections df_out = df_out.assign(min_chainage=np.nan) @@ -486,7 +487,7 @@ def process(beach_name, beach_scenario, n_runs, start_year, end_year, df_out = df_out.assign(segment_gaps=False) for b, p, in zip(segment_gaps['block'], segment_gaps['profile']): - idx = (str(df_out['block']) == str(b)) & (df_out['profile'] + idx = (df_out['block'] == str(b)) & (df_out['profile'] == p) df_out.loc[idx, 'segment_gaps'] = True