Having the follow dataframe
df = pd.DataFrame([[30, 20, {'some_data': 30}]], columns=['a', 'b', 'c'])
I would like to create a new column with the value of some_data value.
I was thinking something like:
df['new_column'] = df['c']['some_data']
Is there a simple way to do it? In reality the dict would be more complex, I will have to get a nested value.
EDIT 1:
Here is a example where I have nested data, it's closer to real problem.
df = pd.DataFrame([[30, 20, {'some_data': [{'other_data': 0}]}]], columns=['a', 'b', 'c'])
# I would like to do something like:
df['new_column'] = df['c']['some_data'][0]['other_data']