📜  python: 转换为 numeirc 类型 - Python 代码示例

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

代码示例1
df['myvar'] = df['myvar'].astype(str)   # Transform as character
df['myvar'] = df['myvar'].astype(float) # Transform as float
df['myvar'] = df['myvar'].astype(int)   # Transform as numeric