i have a dataframe with WooCommerce orders. in this DataFrame I have an order id and the line items. the line items is a json list of items (with lists again), prices and quantities:
[
{u'sku': u'100111', u'total_tax': u'1.11', u'product_id': 4089, u'price': 15.878505, u'tax_class': u'reduced-rate', u'variation_id': 6627, u'taxes': [{u'total': u'1.111495', u'subtotal': u'1.111495', u'id': 35}], u'name': u'prod2', u'meta_data': [{u'value': u'100501', u'id': 74675, u'key': u'SKU'}], u'subtotal_tax': u'1.11', u'total': u'15.88', u'subtotal': u'15.88', u'id': 9956, u'quantity': 1},
{u'sku': u'100222', u'total_tax': u'2.29', u'product_id': 4081, u'price': 32.700935, u'tax_class': u'reduced-rate', u'variation_id': 6632, u'taxes': [{u'total': u'2.289065', u'subtotal': u'2.289065', u'id': 35}], u'name': u'prod1', u'meta_data': [{u'value': u'100302', u'id': 74685, u'key': u'SKU'}], u'subtotal_tax': u'2.29', u'total': u'32.70', u'subtotal': u'32.70', u'id': 9957, u'quantity': 1}
]
I now need to transform all the items in the list to columns in the dataframe and also I need to make n lines (based on the number of lists in the list) out of this one liner.
do you guys have a smart idea?
Thanks! e.
//edit: this is my input:
id line_items
1234 [{u'sku': u'100111'}, {u'sku': u'100222'}]
my expected output would be
id, sku
1234, 100111
1234, 100222