I'd like to convert any cell that is type float
to type int
:
My thought was use lambda functions like this:
df["ev_id"].apply(lambda x: [int(x) if x is type(float)])
But this raises a syntax error which I'm not able to catch. Any help would be much appreciated.
Original data:
ev_id
" "
343.0
234.0
" "
212.0
"Temp"
Transformed:
ev_id
" "
343
234
" "
212
"Temp"