Data Analysis/Python
[python] map함수
[지현]
2021. 7. 28. 18:04
1
2
3
4
5
6
7
|
my_dict = {"a": ['갑', '을'], "b": ['1', '2'], "c": ['2', '4']}
df_temp = pd.DataFrame(my_dict)
pd.DataFrame(my_dict)
temp = {'갑': 'Master1', '을': 'Master2'}
df_temp['a1'] = df_temp['a'].map(temp)
df_temp
|