File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -360,7 +360,7 @@ def _try_sort(iterable):
360
360
except Exception :
361
361
return listed
362
362
363
- def set_printoptions (precision = None , column_space = None , max_rows = None ,
363
+ def set_printoptions (precision = None , column_space = None , max_rows = None ,
364
364
max_columns = None ):
365
365
"""
366
366
Alter default behavior of DataFrame.toString
@@ -523,7 +523,10 @@ def _just_help(x):
523
523
# if we pass col_width, pad-zero the floats so all are same in column
524
524
if col_width is not None and formatted != ' 0' :
525
525
padzeros = col_width - len (formatted )
526
- if padzeros > 0 :
526
+ if padzeros > 0 and 'e' in formatted :
527
+ num , exp = formatted .split ('e' )
528
+ formatted = "%s%se%s" % (num , ('0' * padzeros ), exp )
529
+ elif padzeros > 0 :
527
530
formatted = formatted + ('0' * padzeros )
528
531
529
532
return _just_help (formatted )
Original file line number Diff line number Diff line change @@ -203,9 +203,9 @@ def _myformat(col):
203
203
if issubclass (col .dtype .type , np .floating ):
204
204
col_width = max (map (len , map (formatter , col )))
205
205
formatter = lambda v : _format (v , space = col_space ,
206
- na_rep = self .na_rep ,
207
- float_format = self .float_format ,
208
- col_width = col_width )
206
+ na_rep = self .na_rep ,
207
+ float_format = self .float_format ,
208
+ col_width = col_width )
209
209
return formatter
210
210
211
211
formatters = {} if self .formatters is None else self .formatters
You can’t perform that action at this time.
0 commit comments