I have a dictionary and a dataframe:
dic = {"A":1,"B":2,"C":3,"D":4}
key
0 A
1 C
2 D
3 B
4 A
5 C
6 C
How can I populate the dataframe, using the dictionary, to generate a new dataframe as follows:
key value
0 A 1
1 C 3
2 D 4
3 B 2
4 A 1
5 C 3
6 C 3
Thought about maybe using apply(lambda) function, but with no success.
Thank you!