I want to replace values in one columns based on other columns values :
| Col A| Col B | | ---| ---| | A | 1 | | B | 2 | | C | 3 | | D | 4 | | E | 5 | | A | 6 | | B | 7 | | C | 8 | ...
So, If Column A equal to A, I want to have 1 And If Column A equal to B, I want to have 2
I know it is really easy to do it with "loc" function. However, if unique value of column A is more than 500, it is difficult to replace with just loc function.
Fortunately I have dictionnary like {"A" : 1, "B" : 2,...} with length of 500 (500 unique value)
I don't want to use for or while loop.
I am thinking about map function...but I don't know how to apply it.
Could you help me please ?