-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Make dropq test fail like in issue 1367; then fix bug #1387
Changes from 7 commits
6610a62
7016899
5a79fa4
47777e3
258a531
131e01a
22950f2
9c8c2ef
0523649
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,9 +192,12 @@ def add_weighted_income_bins(pdf, num_bins=10, labels=None, | |
pdf['s006'].values)) | ||
else: | ||
pdf['cumsum_temp'] = np.cumsum(pdf['s006'].values) | ||
min_cumsum = pdf['cumsum_temp'].values[0] | ||
max_cumsum = pdf['cumsum_temp'].values[-1] | ||
bin_edges = [0] + list(np.arange(1, (num_bins + 1)) * | ||
(max_cumsum / float(num_bins))) | ||
cumsum_range = max_cumsum - min_cumsum | ||
bin_width = cumsum_range / float(num_bins) | ||
bin_edges = [-9e99] + list(np.arange(1, (num_bins + 1)) * bin_width) | ||
bin_edges[-1] = 9e99 # raise top of last bin to include all observations | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmmm there's still a minor issue with weighted_by_income_measure option set to True. Since bin_width is stack on top of zero due to the logic of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Amy-Xu said:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That comment was a previous one. Sorry about that. Do you think this current comment is valid? |
||
if not labels: | ||
labels = range(1, (num_bins + 1)) | ||
pdf['bins'] = pd.cut(pdf['cumsum_temp'], bins=bin_edges, labels=labels) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm: the reason of switching to this reform is that it will change not only iitax but also payroll right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Martin got started on this PR because that reform failed: #1387 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Amy-Xu, @MattHJensen is exactly correct. The new reform (with just a payroll tax rate increase) was the reform reported by @PeterDSteinberg as causing a fatal error. So, I revised the test to be like in his bug report and worked until I found what was causing that test failure. Does this make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep that makes sense.