title: Conditionally splitting a column into multiple columns based on another part of a dataframe
body: <p>I have a data frame with 3 columns.</p>
  <pre><code>df = pd.DataFrame({'Cont_ID':[10,10,20,20,30,30],\
  'KEY':['450,512','405,512','450,512','405,512','450,512','405,512'],\
  'VALUE': [3,12,5,23,7,100]})
  
     Cont_ID  KEY          VALUE
  0  10       '450,512'    3
  1  10       '405,512'    12
  2  20       '450,512'    5
  3  20       '405,512'    23
  4  30       '450,512'    7
  5  30       '405,512'    100
  </code></pre>
  <p>In this dataset each cont_ID represents a unique item that has multiple values associated with it. I need to split those values into separate columns.</p>
  <p>I need to create 2 new columns. One needs to hold the value for each plates' associated '405,512' value. The second new column needs to hold the plates associated '450,512' value. The final table would look something like this:</p>
  <pre><code>   Cont_ID  &quot;450-512&quot;  &quot;405-512&quot;
  0  10       3          12
  1  20       5          23
  2  30       7          100
  </code></pre>
  <p>I have tried to do this through several methods, examples listed below, but I am pretty new to both python and pandas, so im not sure where I am going wrong.</p>
  <pre><code>df_split = lambda x: x['VALUE'] if x['KEY'] == &quot;450,512&quot;
  df['450-512'] = df.apply(df_split, axis = 1)
  
  df['450-512'] = df[x['VALUE'] for x in df if df['KEY'] == ['450,512']]
  
  df['450-512'] = df['VALUE'].str.contains('450,512).astype(str)
  </code></pre>
  <p>Any help would be much appreciated!</p>