Skip to content

Commit

Permalink
Issue #325 address pandas future warning that causes current pytests …
Browse files Browse the repository at this point in the history
…to fail.

Remove pandas chaining such as:
  df['column_name'][index] = var_name

with:
 df.loc[index, 'column_name'] = var_name
  • Loading branch information
bikegeek committed Feb 1, 2024
1 parent b037870 commit e2e27bf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions metcalcpy/agg_stat_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e2e27bf

Please sign in to comment.