From e2e27bf4afbf64bf46bd04c3cc2d51a9d8ec14e2 Mon Sep 17 00:00:00 2001 From: bikegeek Date: Wed, 31 Jan 2024 17:42:31 -0700 Subject: [PATCH] Issue #325 address pandas future warning that causes current pytests to fail. Remove pandas chaining such as: df['column_name'][index] = var_name with: df.loc[index, 'column_name'] = var_name --- metcalcpy/agg_stat_bootstrap.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/metcalcpy/agg_stat_bootstrap.py b/metcalcpy/agg_stat_bootstrap.py index 75144618..10ffaeb6 100644 --- a/metcalcpy/agg_stat_bootstrap.py +++ b/metcalcpy/agg_stat_bootstrap.py @@ -209,11 +209,11 @@ def _proceed_with_axis(self, axis="1"): index = rows_with_mask_indy_var.index[0] # save results to the output data frame - out_frame['fcst_var'][index] = fcst_var - out_frame['stat_value'][index] = bootstrap_results.value - out_frame['stat_btcl'][index] = bootstrap_results.lower_bound - out_frame['stat_btcu'][index] = bootstrap_results.upper_bound - out_frame['nstats'][index] = n_stats + out_frame.loc[index, 'fcst_var'] = fcst_var + out_frame.loc[index, 'stat_value'] = bootstrap_results.value + out_frame.loc[index, 'stat_btcl'] = bootstrap_results.lower_bound + out_frame.loc[index, 'stat_btcu'] = bootstrap_results.upper_bound + out_frame.loc[index, 'nstats'] = n_stats else: out_frame = pd.DataFrame() return out_frame