I need to apply a custom transformation to a dataframe like this:
import pandas as pd
df = pd.DataFrame({
'value': ['a'],
'measure':[['b', 'c']]
})
transformed_df = pd.DataFrame({
'measure': ['b', 'c'],
'value': ['a', 'a']
})
What's an efficient way of getting from df to transformed_df?