Taxcalc-Payroll Records#

Taxcalc-Payroll Records

taxcalcpayroll.records#

class taxcalcpayroll.records.Records(data='puf.csv', start_year=2011, gfactors=<taxcalc.growfactors.GrowFactors object>, weights='puf_weights.csv.gz', adjust_ratios='puf_ratios.csv', exact_calculations=False)[source]#

Records is a subclass of Tax-Calculator’s Records class. In fact, Taxcalc-Payroll’s Records class is excatly the same as the Tax-Calculator’s Records class. Therefore, inherits its methods (none of which are shown here).

Constructor for the tax-filing-unit Records class.

Returns:

class instance

Return type:

Records

Notes

Typical usage when using PUF input data is as follows:

recs = Records()

which uses all the default parameters of the constructor, and therefore, imputed variables are generated to augment the data and initial-year grow factors are applied to the data. There are situations in which you need to specify the values of the Record constructor’s arguments, but be sure you know exactly what you are doing when attempting this.

Use Records.cps_constructor() to get a Records object instantiated with CPS input data.

_adjust(year)[source]#

Adjust value of income variables to match SOI distributions Note: adjustment must leave variables as numpy.ndarray type

_extrapolate(year)[source]#

Apply to variables the grow factor values for specified calendar year.

_read_ratios(ratios)[source]#

Read Records adjustment ratios from file or use specified transposed/no-index DataFrame as ratios or create empty DataFrame if None

static cps_constructor(data=None, gfactors=<taxcalc.growfactors.GrowFactors object>, exact_calculations=False)[source]#

Static method returns a Records object instantiated with CPS input data. This works in a analogous way to Records(), which returns a Records object instantiated with PUF input data. This is a convenience method that eliminates the need to specify all the details of the CPS input data just as the default values of the arguments of the Records class constructor eliminate the need to specify all the details of the PUF input data.

increment_year()[source]#

Add one to current year, and also does extrapolation, reweighting, adjusting for new current year.

static read_cps_data()[source]#

Return data in cps.csv.gz as a Pandas DataFrame.