I have some data in this form:
a = [{'table': 'a', 'field':['apple', 'pear']},
{'table': 'b', 'field':['grape', 'berry']}]
I want to create a dataframe that looks like this:
field table
0 apple a
1 pear a
2 grape b
3 berry b
When I try this:
pd.DataFrame.from_records(a)
I get this:
field table
0 [apple, pear] a
1 [grape, berry] b
I'm using a loop to restructure my original data, but I think there must be a more straightforward and simpler methid.