parsing a dictionary in a pandas dataframe cell into new row cells (new columns)
<p>I have a Pandas Dataframe that contains one column containing cells containing a dictionary of key:value pairs, like this:</p>

<pre><code>{"name":"Test Thorton","company":"Test Group","address":"10850 Test #325\r\n","city":"Test City","state_province":"CA","postal_code":"95670","country":"USA","email_address":"test@testtest.com","phone_number":"999-888-3333","equipment_description":"I'm a big red truck\r\n\r\nRSN# 0000","response_desired":"week","response_method":"email"}
</code></pre>

<p>I'm trying to parse the dictionary, so the resulting Dataframe contains a new column for each key and the row is populated with the resulting values for each column, like this:</p>

<pre><code>//Before

1  2  3  4  5
a  b  c  d  {6:y, 7:v}

//After

1  2  3  4  5           6  7
a  b  c  d  {6:y, 7:v}  y  v
</code></pre>

<p>Suggestions much appreciated.</p>

<p>consider <code>df</code></p>

<pre><code>df = pd.DataFrame([
        ['a', 'b', 'c', 'd', dict(F='y', G='v')],
        ['a', 'b', 'c', 'd', dict(F='y', G='v')],
    ], columns=list('ABCDE'))

df
</code></pre>

<p><a href="http://i.stack.imgur.com/Zd89H.png" rel="nofollow"><img src="http://i.stack.imgur.com/Zd89H.png" alt="enter image description here"></a></p>

<hr>

<p>Use <code>apply(pd.Series)</code></p>

<pre><code>df.E.apply(pd.Series)
</code></pre>

<p><a href="http://i.stack.imgur.com/DRAE5.png" rel="nofollow"><img src="http://i.stack.imgur.com/DRAE5.png" alt="enter image description here"></a></p>

<hr>

<p>Assign it like this</p>

<pre><code>df[['F', 'G']] = df.E.apply(pd.Series)
df.drop('E', axis=1)
</code></pre>

<p><a href="http://i.stack.imgur.com/6U1fP.png" rel="nofollow"><img src="http://i.stack.imgur.com/6U1fP.png" alt="enter image description here"></a></p>

python pandas dictionary append multiple-columns