1df['myvar'] = df['myvar'].astype(str) # Transform as character
2df['myvar'] = df['myvar'].astype(float) # Transform as float
3df['myvar'] = df['myvar'].astype(int) # Transform as numeric
1>>> s = pd.Series(["8", 6, "7.5", 3, "0.9"]) # mixed string and numeric values
2>>> s
30 8
41 6
52 7.5
63 3
74 0.9
8dtype: object
9
10>>> pd.to_numeric(s) # convert everything to float values
110 8.0
121 6.0
132 7.5
143 3.0
154 0.9
16dtype: float64
17