@@ -3877,8 +3877,8 @@ def _saveResults(self, data=None, reardata=None, savefile=None, RGB = False):
38773877 setattr (self , col , list (df [col ]))
38783878 # only save a subset
38793879 df = df .drop (columns = ['rearX' ,'rearY' ,'backRatio' ], errors = 'ignore' )
3880- df .to_csv (os .path .join ("results" , savefile ), sep = ',' ,
3881- index = False )
3880+ df .to_csv (os .path .join ("results" , savefile ), sep = ',' ,
3881+ index = False , float_format = '%0.3f' )
38823882
38833883
38843884 print ('Saved: %s' % (os .path .join ("results" , savefile )))
@@ -3922,12 +3922,12 @@ def _saveResultsCumulative(self, data, reardata=None, savefile=None):
39223922 df .to_csv (savefile , sep = ',' ,
39233923 columns = ['x' ,'y' ,'z' ,'rearZ' ,'mattype' ,'rearMat' ,
39243924 'Wm2Front' ,'Wm2Back' ,'Back/FrontRatio' ],
3925- index = False ) # new in 0.2.3
3925+ index = False , float_format = '%0.3f' ) # new in 0.2.3
39263926
39273927 else :
39283928 df = pd .DataFrame .from_dict (data_sub )
3929- df .to_csv (savefile , sep = ', ' ,
3930- columns = ['x' ,'y' ,'z' , 'mattype' ,'Wm2' ], index = False )
3929+ df .to_csv (savefile , sep = ',' , float_format = '%0.3f ' ,
3930+ columns = ['x' ,'y' ,'z' , 'mattype' ,'Wm2' ], index = False )
39313931
39323932 print ('Saved: %s' % (savefile ))
39333933 return (savefile )
0 commit comments