title: split each cell in dataframe (pandas/python)
body: <p>I have a large pandas dataframe consisting of many rows and columns containing binary data like '0|1', '0|0','1|1','1|0'  which i would like to split either in 2 dataframes, and/or expand so that this (both are useful to me):</p>
  
  <pre><code>        a   b   c   d
  rowa    1|0 0|1 0|1 1|0
  rowb    0|1 0|0 0|0 0|1
  rowc    0|1 1|0 1|0 0|1
  </code></pre>
  
  <p>becomes</p>
  
  <pre><code>        a   b   c   d
  rowa1   1   0   0   1
  rowa2   0   1   1   0
  rowb1   0   0   0   0
  rowb2   1   0   0   1
  rowc1   0   1   1   0
  rowc2   1   0   0   1
  </code></pre>
  
  <p>and/or </p>
  
  <pre><code>    df1:    a   b   c   d
      rowa    1   0   0   1
      rowb    0   0   0   0
      rowc    0   1   1   0
  
  
      df2:    a   b   c   d
      rowa    0   1   1   0
      rowb    1   0   0   1
      rowc    1   0   0   1
  </code></pre>
  
  <p>currently i'm trying to do something like the following, but believe this is not very effective, any guidance would be helpful. </p>
  
  <pre><code>Atmp_dict=defaultdict(list)
  Btmp_dict=defaultdict(list)
  
  for index,row in df.iterrows():
      for columnname in list(df.columns.values):
          Atmp_dict[columnname].append(row[columnname].split('|')[0])
          Btmp_dict[columnname].append(row[columnname].split('|')[1])
  </code></pre>