Dec-12-2019, 08:44 AM
try if round helps here,
source:trim_numbers.csv
a
-10949.600833
-21294.745833
-21679.851667
-100706.196667
-21648.102500
-149756.456667
-19041.302500
-14257.553333
-15648.158333
Sandeep
GANGA SANDEEP KUMAR
source:trim_numbers.csv
a
-10949.600833
-21294.745833
-21679.851667
-100706.196667
-21648.102500
-149756.456667
-19041.302500
-14257.553333
-15648.158333
import pandas as pd test = pd.read_csv('trim_numbers.csv', sep=",", index_col=False) blankIndex=[''] * len(test) test.index=blankIndex test.columns = test.columns.str.lower() ''' print(test.astype(float)) print(test.astype(int)) print(((test.astype(int)-test.astype(float))*100).astype(int)/100) print(test.astype(int)-((test.astype(int)-test.astype(float))*100).astype(int)/100) ''' print(test['a'].dtype) print('---------------') print(test['a']) test['a']=test['a'].round(2) print(test['a'])Best Regards,
Sandeep
GANGA SANDEEP KUMAR