I am writing a function to change from float to integer. Right now, for example, if the value is 1.34, the code returns 1.0 instead of 1. How to solve this problem?
dataframe.iloc[:,i] = dataframe.iloc[:,i].apply(lambda x: int(x) if str(x) != 'nan' else x)