I have a df,
A B
one six
two seven
three level
five one
and a dictionary
my_dict={1:"one,two",2:"three,four"}
I want to replace df.A with my_dict keys().
My desired output is,
A B
1 six
1 seven
2 level
five one
I tried df.A.replace(my_dict,regex=True)
but it doesn't work.