title: One-hot encoding in Python for array values in a DataFrame
body: <p>I am trying to do one-hot encoding for these clustered data frames. (grouped by length). Been trying to use sklearn's encoder but it seems to regard each individual row as one category instead of multiple.</p>
  <p>Example input:</p>
  <pre><code> ID                    trace  length
   3              [A, B, C, C]       4
   4           [A, B, C, C, D]       5
   5        [A, B, C, C, D, E]       6
   24             [A, B, C, C]       4
   25          [A, B, C, C, D]       5
   ...                     ...     ...
  </code></pre>
  <p>Expected output :</p>
  <pre><code>ID     A  B  C  D  E    length
  3      1  1  1  0  0         4
  4      1  1  1  1  0         5
  5      1  1  1  1  1         6
  24     1  1  1  0  0         4
  25     1  1  1  1  0         5
  .... ..... .. ......
  </code></pre>