Skip to content

Commit

Permalink
reset_index is performed on the float value #322 (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
TatianaBurek authored Aug 22, 2023
1 parent 227b264 commit 3baae11
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions metcalcpy/util/pstd_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 3baae11

Please sign in to comment.