Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused argument from means_and_comparisons utility function #1044

Merged
merged 1 commit into from
Nov 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion taxcalc/dropq/dropq_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def create_dropq_difference_table(df1, df2, groupby, res_col, diff_col,
# Negative values are the magnitude of the tax decrease
df2[res_col + suffix] = df2[diff_col + suffix] - df1[diff_col]

diffs = means_and_comparisons(df2, res_col + suffix,
diffs = means_and_comparisons(res_col + suffix,
df.groupby('bins', as_index=False),
wsum + EPSILON)

Expand Down
10 changes: 4 additions & 6 deletions taxcalc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,13 @@ def add_income_bins(pdf, compare_with='soi', bins=None, right=True,
return pdf


def means_and_comparisons(pdf, col_name, gpdf, weighted_total):
def means_and_comparisons(col_name, gpdf, weighted_total):
"""
Return Pandas DataFrame based specified grouped values of col_name in
specified gpdf Pandas DataFrame.
pdf: Pandas DataFrame for full results of calculation (NEVER USED)
Return new Pandas DataFrame based on grouped values of specified
col_name in specified gpdf Pandas DataFrame.
col_name: the column name to calculate against
gpdf: grouped Pandas DataFrame
"""
# pylint: disable=unused-argument
# Who has a tax cut, and who has a tax increase
diffs = gpdf.apply(weighted_count_lt_zero, col_name)
diffs = pd.DataFrame(data=diffs, columns=['tax_cut'])
Expand Down Expand Up @@ -514,7 +512,7 @@ def create_difference_table(recs1, recs2, groupby,
# Positive values are the magnitude of the tax increase
# Negative values are the magnitude of the tax decrease
res2['tax_diff'] = res2[income_to_present] - res1[income_to_present]
diffs = means_and_comparisons(res2, 'tax_diff',
diffs = means_and_comparisons('tax_diff',
pdf.groupby('bins', as_index=False),
(res2['tax_diff'] * res2['s006']).sum())
sum_row = get_sums(diffs)[diffs.columns.values.tolist()]
Expand Down