I have a dictionary where each key has a list of values. Length of the list associated with each key is different. I want to convert the dictionary into a pandas dataframe with two columns 'Key' and 'Values'. Each row having one dictionary key in the 'Key' column and the list of values associated with it in 'Values' column. The dataframe will look as follows:
mapping_dict = {'A':['a', 'b', 'c', 'd'], 'B':['aa', 'bb', 'cc']}
df =
Key Value
0 A ['a', 'b', 'c', 'd']
1 B ['aa', 'bb', 'cc']
I tried using the answer provided here by modifying it as per my use case. But it didn't output the required answer.