Say I have a DataFrame like the following:
df = pd.DataFrame({'baz': ['yes','fine'], 'foo': [['a', 'b', 'c'], ['s', 'r']]},
index=['W1', 'W2'])
> df
baz foo
W1 yes [a, b, c]
W2 fine [s, r]
How can I expand the column foo
? The result should be, in this case:
> df
baz foo
W1 yes a
yes b
yes c
W2 fine s
fine r