Oct-25-2020, 11:22 PM
How can we help, if there is no code except the dictionary?
If you use pandas, you can do it easily, e.g.
If you use pandas, you can do it easily, e.g.
In [75]: import pandas as pd ...: ...: mapper = {1: 'John', 2: 'July'} ...: ...: df = pd.DataFrame({'names': [1, 2, 1, 1], 'age': [10, 20, 10, 10]}) ...: ...: df.names.map( mapper)
Output:Out[75]:
0 John
1 July
2 John
3 John
Name: names, dtype: object