Q:

Truncate column in data frame from float to int

I have a data-frame (df) that has an Age column, and looks like
              Age
0       59.917864
1       50.387406
2       50.387406
3       55.008898

I am trying to crearte a new column call Age_truncated which would be the Age column as an integer and would look like:
              Age  Age_truncated
0       59.917864             59  
1       50.387406             50
2       50.387406             50
3       55.008898             55

I have tried:
df[("Age_truncated")] = df["Age"].astype(int)
df["Age_truncated"] = int(df["Age"])

without success.  What further things could I try?

A:

You can using floor from numpy
df['Age1']=np.floor(df.Age).astype(int)
df
Out[414]: 
         Age  Age1
0  59.917864    59
1  50.387406    50
2  50.387406    50
3  55.008898    55

