📅  最后修改于: 2022-03-11 14:45:09.731000             🧑  作者: Mango
df = pd.DataFrame({'a':['Small', 'Medium', 'High']})
In [22]: df
Out[22]:
a
0 Small
1 Medium
2 High
[3 rows x 1 columns]
df.replace({'a' : { 'Medium' : 2, 'Small' : 1, 'High' : 3 }})