In [1]:
from synthpop.synthesizer import synthesize, enable_logging
import synthpop.categorizer as cat

import multiprocessing
import os
import seaborn as sns
from functools import partial
import pandas as pd

import synthpop.zone_synthesizer as zs

In [2]:
hh_marginal_file = 'input_data/hh_marginals.csv'
person_marginal_file = 'input_data/person_marginals.csv'
hh_sample_file = 'input_data/household_sample.csv'
person_sample_file = 'input_data/person_sample.csv'

In [3]:
hh_marg, p_marg, hh_sample, p_sample, xwalk = zs.load_data(hh_marginal_file, person_marginal_file, hh_sample_file, person_sample_file)

In [4]:
all_households, all_persons, all_stats = zs.synthesize_all_zones(hh_marg, p_marg, hh_sample, p_sample, xwalk)


c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 254 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 306 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 356 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 390 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 601 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 324 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 556 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 342 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 273 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 228 households
Drawing 857 households
Drawing 748 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 744 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 953 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 719 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 185 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 183 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 286 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 317 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 711 households
c:\users\juan\documents\github\synthpop\synthpop\ipu\ipu.py:190: RuntimeWarning: divide by zero encountered in double_scalars
  adj = constraint / (column * weights).sum()
Drawing 345 households

In [5]:
all_persons, all_households, all_stats = zs.multiprocess_synthesize(hh_marg, p_marg, hh_sample, p_sample, xwalk)

In [6]:
sns.distplot(all_persons.cat_id)


C:\Users\Juan\Anaconda3\envs\synpop_py3\lib\site-packages\matplotlib\axes\_axes.py:6448: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.
  warnings.warn("The 'normed' kwarg is deprecated, and has been "
Out[6]:
<matplotlib.axes._subplots.AxesSubplot at 0x29689d13438>

In [ ]: