本文整理汇总了Python中taxcalc.Calculator.decile_graph方法的典型用法代码示例。如果您正苦于以下问题:Python Calculator.decile_graph方法的具体用法?Python Calculator.decile_graph怎么用?Python Calculator.decile_graph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类taxcalc.Calculator
的用法示例。
在下文中一共展示了Calculator.decile_graph方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_dec_graph_plots
# 需要导入模块: from taxcalc import Calculator [as 别名]
# 或者: from taxcalc.Calculator import decile_graph [as 别名]
def test_dec_graph_plots(cps_subsample):
pol = Policy()
rec = Records.cps_constructor(data=cps_subsample)
calc1 = Calculator(policy=pol, records=rec)
year = 2020
calc1.advance_to_year(year)
reform = {
'SS_Earnings_c': {year: 9e99}, # OASDI FICA tax on all earnings
'FICA_ss_trt': {year: 0.107484} # lower rate to keep revenue unchanged
}
pol.implement_reform(reform)
calc2 = Calculator(policy=pol, records=rec)
calc2.advance_to_year(year)
assert calc1.current_year == calc2.current_year
calc1.calc_all()
calc2.calc_all()
fig = calc1.decile_graph(calc2)
assert fig
dt1, dt2 = calc1.distribution_tables(calc2, 'weighted_deciles')
dta = dec_graph_data(dt1, dt2, year,
include_zero_incomes=True,
include_negative_incomes=False)
assert isinstance(dta, dict)
dta = dec_graph_data(dt1, dt2, year,
include_zero_incomes=False,
include_negative_incomes=True)
assert isinstance(dta, dict)
dta = dec_graph_data(dt1, dt2, year,
include_zero_incomes=False,
include_negative_incomes=False)
assert isinstance(dta, dict)