Skip to content

Commit

Permalink
avoid use of append
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Feb 8, 2024
1 parent 2c63597 commit 4e0a992
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions taxbrain/report.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import shutil
import pandas as pd
import behresp
import taxbrain
import taxcalc as tc
Expand Down Expand Up @@ -178,9 +179,9 @@ def export_plot(plot, graph):
tb.start_year, "weighted_deciles", "combined"
).fillna(0)
# move the "ALL" row to the bottom of the DataFrame
row = decile_diff_table.loc["ALL"].copy()
decile_diff_table.drop("ALL", inplace=True)
decile_diff_table = decile_diff_table.append(row)
target_row = decile_diff_table.loc["ALL", :]
decile_diff_table = decile_diff_table.shift(-1)
decile_diff_table.iloc[-1] = target_row.squeeze()

# find which income bin sees the largest change in tax liability
largest_change = largest_tax_change(diff_table)
Expand Down

0 comments on commit 4e0a992

Please sign in to comment.