Pandas add new columns based on splitting another column
<p>I have a pandas dataframe like the following:</p>

<pre><code>A              B
US,65,AMAZON   2016
US,65,EBAY     2016
</code></pre>

<p>My goal is to get to look like this:</p>

<pre><code>A              B      country    code    com
US.65.AMAZON   2016   US         65      AMAZON
US.65.AMAZON   2016   US         65      EBAY
</code></pre>

<p>I know this question has been asked before <a href="https://stackoverflow.com/questions/14745022/pandas-dataframe-how-do-i-split-a-column-into-two">here</a> and <a href="https://stackoverflow.com/questions/25789445/pandas-make-new-column-from-string-slice-of-another-column#_=_">here</a> but <strong>none</strong> of them works for me. I have tried: </p>

<pre><code>df['country','code','com'] = df.Field.str.split('.')
</code></pre>

<p>and</p>

<pre><code>df2 = pd.DataFrame(df.Field.str.split('.').tolist(),columns = ['country','code','com','A','B'])
</code></pre>

<p>Am I missing something? Any help is much appreciated.</p>