title: How do I remap a dataframe with a dict containing nested list using map function?
body: <p>I have a dataframe like this:</p>
  <pre><code>    ID
  0   123
  1   123
  2   123
  3   123
  4   123
  5   123
  6   456
  7   456
  8   456
  9   123
  </code></pre>
  <p>I want to add a new column with <code>map</code> function using dict d:</p>
  <pre><code>d = {'123': [1, 2, 3, 1, 2, 1, 5], '456': [1, 2, 1]}
  </code></pre>
  <p>Expected output:</p>
  <pre><code>    ID  Count
  0   123   1
  1   123   2
  2   123   3
  3   123   1
  4   123   2
  5   123   1
  6   456   1
  7   456   2
  8   456   1
  9   123   5
  </code></pre>
  <p>But <code>df.ID.map(d)</code> returns:</p>
  <pre><code>0    [1, 2, 3, 1, 2, 1, 5]
  1    [1, 2, 3, 1, 2, 1, 5]
  2    [1, 2, 3, 1, 2, 1, 5]
  3    [1, 2, 3, 1, 2, 1, 5]
  4    [1, 2, 3, 1, 2, 1, 5]
  5    [1, 2, 3, 1, 2, 1, 5]
  6             [1, 2, 1]
  7             [1, 2, 1]
  8             [1, 2, 1]
  9    [1, 2, 3, 1, 2, 1, 5]
  </code></pre>