Extract dictionary value from column in data frame
<p>I'm looking for a way to optimize my code. </p>

<p>I have entry data in this form:</p>

<pre><code>import pandas as pn

a=[{'Feature1': 'aa1','Feature2': 'bb1','Feature3': 'cc2' },
 {'Feature1': 'aa2','Feature2': 'bb2' },
 {'Feature1': 'aa1','Feature2': 'cc1' }
 ]
b=['num1','num2','num3']


df= pn.DataFrame({'num':b, 'dic':a })
</code></pre>

<p>I would like to extract element 'Feature3' from dictionaries in column 'dic'(if exist) in above data frame. So far I was able to solve it but I don't know if this is the fastest way, it seems to be a little bit over complicated.</p>

<pre><code>Feature3=[]
for idx, row in df['dic'].iteritems():
    l=row.keys()

    if 'Feature3' in l:
        Feature3.append(row['Feature3'])
    else:
        Feature3.append(None)

df['Feature3']=Feature3
print df
</code></pre>

<p>Is there a better/faster/simpler way do extract this Feature3 to separate column in the dataframe?</p>

<p>Thank you in advance for help.</p>