I have a pandas dataframe as follows:
a = pd.DataFrame({\'col1\': (\'x\',\'y\'), \'col2\':(1,2)})
I want to extract variable and associated v