📌  相关文章
📜  pandas 用特定值替换特定列中的数据 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:22.830000             🧑  作者: Mango

代码示例1
### replace one value ###
df["column"].replace("US","UK") # you can also use numerical values
### replace more than one value ###
df["column"].replace(["man","woman","child"],[1,2,3]) # you can also use numerical values
#   man ==> 1
# woman ==> 2
# child ==> 3