From 3baae11c4a145c76ffa78511347457c84feecd77 Mon Sep 17 00:00:00 2001 From: Tatiana Burek Date: Tue, 22 Aug 2023 08:58:34 -0600 Subject: [PATCH] reset_index is performed on the float value #322 (#323) --- metcalcpy/util/pstd_statistics.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/metcalcpy/util/pstd_statistics.py b/metcalcpy/util/pstd_statistics.py index 8d9f96da..6a890d7a 100644 --- a/metcalcpy/util/pstd_statistics.py +++ b/metcalcpy/util/pstd_statistics.py @@ -41,16 +41,13 @@ def calculate_pstd_brier(input_data, columns_names): t_table = df_pct_perm['n_i'].sum() o_bar_table = df_pct_perm['oy_i'].sum() / t_table o_bar = input_data[0, get_column_index_by_name(columns_names, 'o_bar')] - - t_table.reset_index(inplace=True, drop=True) - reliability = calc_reliability(t_table, df_pct_perm) resolution = calc_resolution(t_table, df_pct_perm, o_bar) uncertainty = calc_uncertainty(o_bar_table) brier = reliability - resolution + uncertainty result = round_half_up(brier, PRECISION) - except (TypeError, ZeroDivisionError, Warning, ValueError): + except (TypeError, ZeroDivisionError, Warning, ValueError, AttributeError): result = None warnings.filterwarnings('ignore') return result @@ -75,8 +72,6 @@ def calculate_pstd_bss_smpl(input_data, columns_names): t_table = df_pct_perm['n_i'].sum() o_bar_table = df_pct_perm['oy_i'].sum() / t_table o_bar = input_data[0, get_column_index_by_name(columns_names, 'o_bar')] - - t_table.reset_index(inplace=True, drop=True) reliability = calc_reliability(t_table, df_pct_perm) resolution = calc_resolution(t_table, df_pct_perm, o_bar) uncertainty = calc_uncertainty(o_bar_table) @@ -161,7 +156,6 @@ def calculate_pstd_resolution(input_data, columns_names): df_pct_perm = _calc_common_stats(columns_names, input_data) o_bar = input_data[0, get_column_index_by_name(columns_names, 'o_bar')] t_table = df_pct_perm['n_i'].sum() - t_table.reset_index(inplace=True, drop=True) resolution = calc_resolution(t_table, df_pct_perm, o_bar) result = round_half_up(resolution, PRECISION) except (TypeError, ZeroDivisionError, Warning, ValueError):