Skip to content

Commit

Permalink
update for new pandas
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Feb 4, 2024
1 parent 44cb97b commit 055c6ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions taxcalc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ def add_income_table_row_variable(dframe, income_measure, bin_edges):
assert isinstance(bin_edges, list)
dframe['table_row'] = pd.cut(dframe[income_measure],
bin_edges, right=False)

return dframe


Expand Down Expand Up @@ -539,8 +540,7 @@ def count_gt_zero(dframe, col_name, tolerance=0.001):
df2, baseline_expanded_income, SOI_AGI_BINS)
del df2
# create grouped Pandas DataFrame
gdf = dframe.groupby('table_row', as_index=False)
del dframe['table_row']
gdf = dframe.groupby('table_row', as_index=False, observed=False)
# create additive difference table statistics from gdf
diff_table = additive_stats_dataframe(gdf)
# calculate additive statistics on sums row
Expand Down

0 comments on commit 055c6ee

Please sign in to comment.