title: Best way to transform Pandas DataFrame column
body: <p>I'm new to pandas, and am wondering about the best way to accomplish this data transformation. The method below works, but I have a feeling that it can be done more cleanly/efficiently.</p>
  
  <p>I have Office information that can be in the form:</p>
  
  <ul>
  <li>"&lt;building&gt;/&lt;office&gt;"</li>
  <li>"&lt;building&gt;"</li>
  <li>&lt;building number&gt; (int)</li>
  <li>'' (empty string)</li>
  <li>None</li>
  </ul>
  
  <p>I'd like to convert this into Building and Office columns.</p>
  
  <p>Given the data:</p>
  
  <pre><code>df = pandas.DataFrame({ "Office" : [ "Building Foo/10", "Building Only", None, 100, ""]})
  df
  
      Office
  0   Building Foo/10
  1   Building Only
  2   None
  3   100
  4   
  </code></pre>
  
  <p>I can transform it via:</p>
  
  <pre><code>items = [ (str(row["Office"]) or '').rsplit('/', 1) for _, row in df.iterrows() ]
  items = [ item if len(item) == 2 else (item[0] or None, None) for item in items ]
  
  df["Building"], df["Office"] = zip(*items)
  df
  
      Office  Building
  0   10      Building Foo
  1   None    Building Only
  2   None    None
  3   None    100
  4   None    None
  </code></pre>
  
  <p>What is the best way to do this using pandas?</p>
  
  <p>Thanks for the help!</p>