title: Pandas get_dummies on multiple columns
body: <p>I have a dataset with multiple columns that I wish to one hot encode. However, I don't want to have the encoding for each one of them since said columns are related to the said items. What I want is one "set" of dummies variables that uses all the columns. See my code for a better explanation.</p>
  
  <p>Suppose my dataframe looks like this:</p>
  
  <pre><code>In [103]: dum = pd.DataFrame({'ch1': ['A', 'C', 'A'], 'ch2': ['B', 'G', 'F'], 'ch3': ['C', 'D', 'E']})
  
  In [104]: dum
  Out[104]:
   ch1 ch2 ch3
  0   A   B   C
  1   C   G   D
  2   A   F   E
  </code></pre>
  
  <p>If I execute</p>
  
  <pre><code>pd.get_dummies(dum)
  </code></pre>
  
  <p>The output will be</p>
  
  <pre><code>   ch1_A  ch1_C  ch2_B  ch2_F  ch2_G  ch3_C  ch3_D  ch3_E
   0      1      0      1      0      0      1      0      0
   1      0      1      0      0      1      0      1      0
   2      1      0      0      1      0      0      0      1
  </code></pre>
  
  <p>However, what I would like to obtain is something like this:</p>
  
  <pre><code> A B C D E F G
   1 1 1 0 0 0 0
   0 0 1 1 0 0 1
   1 0 0 0 1 1 0
  </code></pre>
  
  <p>Instead of having multiple columns representing the encoding, e.g. <code>ch1_A</code> and <code>ch1_C</code>, I only wish to have one group (<code>A</code>, <code>B</code>, and so on) with value <code>1</code> when any of the values in the columns <code>ch1</code>, <code>ch2</code>, <code>ch3</code> show up.</p>
  
  <p>To clarify, in my original dataset, a single row won't contain the same value (A,B,C...) more than once; it will just appear on one of the columns.</p>