title: Splitting strings containing newline command and outputting to two columns
body: <p>A minimal example of my data looks as follows:</p>
  <pre><code>import pandas as pd
  
  data = {'address': ['STREET ADDRESS', 'C/O NAME LASTNAME\nOTHER STREET ADDRESS'], 'coaddress':['', '']}
  
  df = pd.DataFrame(data)
  
  df
  </code></pre>
  <p>I am looking for a way (using <code>pandas</code>, preferably) to:</p>
  <ol>
  <li>identify rows in which the <code>address</code> column contains &quot;C/O&quot;, and</li>
  <li>split the string at the newline (<code>\n</code>) command and output the part of the string <em>before</em> the newline command to the corresponding row in the <code>coaddress</code> column and keep the part of the string <em>after</em> the newline command in the <code>address</code> column.</li>
  </ol>
  <p>The df I want to achieve looks as follows:</p>
  <pre><code>desired_data = {'address': ['STREET ADDRESS', 'OTHER STREET ADDRESS'], 'coaddress':['', 'C/O NAME LASTNAME']}
  
  desired_df = pd.DataFrame(desired_data)
  
  desired_df
  </code></pre>
  <p>Any suggestions on how to achieve this? Thanks!</p>