I have a list that i would like to convert to dataframe. I have around 30000 lists in a variable called data. how do i convert this into a dataframe with columns properties, product_id,description,ustomer_id and country. I want the element properties to be converted to a dataframe
data[0]
Out[16]:
{'event': 'Product',
'properties': {'invoice_no': '44',
'product_id': '67',
'description': 'cloth',
'customer_id': 55,
'country': 'US'}}
data[1]
Out[17]:
{'event': 'Product',
'properties': {'invoice_no': '55',
'product_id': '66',
'description': 'shoe',
'customer_id': 23,
'country': 'China'}}
Tried this ,
new = pd.DataFrame.from_dict(data)
but it gave only two columns such as 'event' and 'properties'. I want properties to form a dataframe