python: transform as type numeirc

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

Here is what the above code is Doing:
1. Convert the column to a string
2. Convert the column to a float
3. Convert the column to an integer

The reason for this is that when you convert a column to a float, the decimal places are dropped.

So, if you have a column that looks like this:

1.0
2.0
3.0
4.0
5.0

It will look like this when you convert it to an integer:

1
2
3
4
5

And if you have a column that looks like this:

1.1
2.2
3.3
4.4
5.5

It will look like this when you convert it to an integer:

1
2
3
4
5

So, you need to convert it to a float first, so that the decimal places are retained, and then convert it to an integer.