incomevis.vis

incomevis.vis.visualize

visualize(k='decile', input_path='', max_income=400000)

Get interactive visualization in AmChart. Receive deflated data of one year with normalized (potentially unrounded) population with details. The data is assumed to have (1) an index column using State, (2) kiles name, (3) NORMPOP, (4) Label, and (5) Color in hexadecimal form (e.g. #FFE000). There is no particular requirement on order of these fields. Regardless of the state order in the input, the output will always be sorted (left to right) according to the 50p.

Parameters
  • input_path (str) – Absolute path to data file. Unlike the animate function, there is no requirement of naming format for this function. Default: Empty string

  • k (str) – Method of partitioning income, which is either 'decile' or 'percentile'. Default: 'decile'.

  • max_income (int) – Maximum income to be display on the vertical axis

Returns

The HTML object displaying the 3D graph in IPython notebook environments (which can be Colab Notebook or Jupyter Notebook).

Return type

IPython.display.HTML object

incomevis.vis.animate

animate(incomeType='RPPERHHINCOME', k='decile', group='all', year_start=1977, year_end=2020, highlight='', benchmark=True, benchmark_path='/home/docs/checkouts/readthedocs.org/user_builds/incomevis/data/benchmark_data/', input_path='/home/docs/checkouts/readthedocs.org/user_builds/incomevis/data/deflated_data/')

Animate economic distribution over year.

Parameters
  • incomeType (str) – Type of household income. Currently supported 'HHINCOME', 'RHHINCOME', 'ERHHINCOME', and 'RPPERHHINCOME'. Default: 'RPPERHHINCOME', i.e. fully deflated.

  • k (str) – Method of partitioning income, which is either 'decile' or 'percentile'. Default: 'decile'.

  • year_start (int) – Starting year of data that will be printed out. Default: 1977, i.e. the earliest year household income was meaningfully documented by IPUMS.

  • year_end (int) – Ending year of data that will be printed out. Unlike pandas index convention, the ending data year will be included in render. Default: 2020.

  • highlight (str) – State to highlight. Default: empty string.

  • group (str) – Allowing to export (sub)population of data. Currently supported 'all', 'male', 'female', 'black', 'non-black', 'hispan', 'non-hispan', 'high-educ', 'low-educ'. Default: 'all'.

  • benchmark (bool) – Whether the exporting data is the benchmark data. If benchmark = True, the default benchmark data is the national income (with respect to the selected income type) at 'year_end'. Default: False.

  • benchmark_path (str) – Benchmark directory. Default: BENCHMARK_DATA_PATH.

  • input_path (str) – Path to data to animate. Default: DEFLATED_DATA_PATH