Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. import dropq
  2. import pandas as pd
  3. import taxcalc
  4. import json
  5.  
  6. first_year = 2016
  7. myvars = {'_BE_sub':[0.4], '_STD_Aged': [[0, 0, 0, 0, 1550, 1250]], '_CTC_additional': [2500.0], '_II_credit': [[2000, 4000, 2000, 3000]], '_II_rt1': [0.0], '_II_rt3': [0.0], '_II_rt2': [0.0], '_II_credit_ps': [[150000, 300000, 150000, 200000]], '_II_rt4': [0.0], '_ID_StateLocalTax_HC': [1.0], '_II_rt6': [0.25], '_NIIT_trt': [0.0], '_II_rt5': [0.15], '_CG_rt3': [0.0], '_CG_rt2': [0.0], '_II_rt7': [0.35], '_ID_Miscellaneous_frt': [5.0], '_ID_BenefitSurtax_Switch': [[True, True, True, True, True, True, True]], '_ID_Medical_frt': [5.0], '_ID_Casualty_frt': [5.0], '_BE_CG_per': [0.78], '_ID_RealEstate_HC': [1.0], '_AMT_trt1': [0.0], '_AMT_trt2': [0.0], '_STD': [[0, 0, 0, 0, 12600, 6300, 1050]], '_II_credit_prt': [0.04], '_II_brk5': [[75000, 150000, 75000, 100000, 413350, 206675]], '_II_brk4': [[0, 0, 0, 0, 231450, 115725]], '_II_brk6': [[150000, 300000, 150000, 200000, 466950, 233475]], '_II_brk1': [[0, 0, 0, 0, 18550, 9275]], '_II_brk3': [[0, 0, 0, 0, 151900, 75950]], '_II_brk2': [[0, 0, 0, 0, 75300, 37650]]}
  8.  
  9. user_mods = {first_year: myvars}
  10.  
  11. #Create a Public Use File object
  12. tax_dta = pd.read_csv("puf.csv.gz", compression='gzip')
  13. mY_dec, mX_dec, df_dec, pdf_dec, cdf_dec, mY_bin, mX_bin, df_bin, pdf_bin, cdf_bin, fiscal_tots = dropq.run_models(tax_dta, num_years=3, start_year=first_year, user_mods=user_mods)
  14.  
  15. with open("mY_dec2be.txt", "w") as f1:
  16. f1.write(json.dumps(mY_dec, sort_keys=True, indent=4, separators=(',', ': ')) + '\n')
  17.  
  18. with open("mX_dec2be.txt", "w") as f1:
  19. f1.write(json.dumps(mX_dec, sort_keys=True, indent=4, separators=(',', ': ')) + '\n')
  20.  
  21. with open("df_dec2be.txt", "w") as f1:
  22. f1.write(json.dumps(df_dec, sort_keys=True, indent=4, separators=(',', ': ')) + '\n')
  23.  
  24. with open("pdf_dec2be.txt", "w") as f1:
  25. f1.write(json.dumps(pdf_dec, sort_keys=True, indent=4, separators=(',', ': ')) + '\n')
  26.  
  27. with open("cdf_dec2be.txt", "w") as f1:
  28. f1.write(json.dumps(cdf_dec, sort_keys=True, indent=4, separators=(',', ': ')) + '\n')
  29.  
  30. with open("mY_bin2be.txt", "w") as f1:
  31. f1.write(json.dumps(mY_bin, sort_keys=True, indent=4, separators=(',', ': ')) + '\n')
  32.  
  33. with open("mX_bin2be.txt", "w") as f1:
  34. f1.write(json.dumps(mX_bin, sort_keys=True, indent=4, separators=(',', ': ')) + '\n')
  35.  
  36. with open("df_bin2be.txt", "w") as f1:
  37. f1.write(json.dumps(df_bin, sort_keys=True, indent=4, separators=(',', ': ')) + '\n')
  38.  
  39. with open("pdf_bin2be.txt", "w") as f1:
  40. f1.write(json.dumps(pdf_bin, sort_keys=True, indent=4, separators=(',', ': ')) + '\n')
  41.  
  42. with open("cdf_bin2be.txt", "w") as f1:
  43. f1.write(json.dumps(cdf_bin, sort_keys=True, indent=4, separators=(',', ': ')) + '\n')
  44.  
  45. with open("fiscal_tots2be.txt", "w") as f1:
  46. f1.write(json.dumps(fiscal_tots, sort_keys=True, indent=4, separators=(',', ': ')) + '\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement