title: Imputation on pandas value_counts
body: <p>I have two python pandas value_counts tables T1 and T2, where T2 contains an additional variable compared to T1. I would like to merge these two value_counts tables. In order to do so, I would like to impute the missing variable in T1, through sampling from the distribution of T2. After imputation, both tables should be merged. However, I have no idea how to access the value_counts tables correctly.</p>
  <p>Example:</p>
  <p>T1:<br />
  <code>A: True, count=100</code><br />
  <code>A: False, count=200</code></p>
  <p>T2:<br />
  <code>A: True, B: True,   count=30</code><br />
  <code>A: True  B: False,  count=10</code><br />
  <code>A: False, B: True,  count=20</code><br />
  <code>A: False, B: True,  count=30</code></p>
  <p>Result:<br />
  <code>A: True, B: True,   count=105  (100 x 30/40 + 30)</code><br />
  <code>A: True  B: False,  count=35   (100 x 10/40 + 10)</code><br />
  <code>A: False, B: True,  count=100  (200 x 20/50 + 20)</code><br />
  <code>A: False, B: True,  count=150  (200 x 30/50 + 30)</code></p>
  <p>I would really appreciate some help on how to perform this task. Thank you!</p>