I am trying to create a dataframe from a list of values which has nested dictionaries So this is my data
d=[{'user': 200,
'p_val': {'a': 10, 'b': 200},
'f_val': {'a': 20, 'b': 300},
'life': 8},
{'user': 202,
'p_val': {'a': 100, 'b': 200},
'f_val': {'a': 200, 'b': 300},
'life': 8}]
i am trying to turn it into a dataframe as follows:
user new_col f_val p_val life
200 a 20 10 8
200 b 300 200 8
202 a 200 100 8
202 b 300 200 8
I looked at other answers, none of them matched my requirement. The nearest I could find was this, and still did not work me. Any help would be much appreciated! Thank you