@@ -254,7 +254,7 @@ def _get_formatted_values(self):
254254 values_to_format = self .tr_series ._formatting_values ()
255255
256256 if self .index :
257- leading_space = None
257+ leading_space = 'compat'
258258 else :
259259 leading_space = False
260260 return format_array (values_to_format , None ,
@@ -712,7 +712,7 @@ def _format_col(self, i):
712712 values_to_format = frame .iloc [:, i ]._formatting_values ()
713713
714714 if self .index :
715- leading_space = None
715+ leading_space = 'compat'
716716 else :
717717 leading_space = False
718718 return format_array (values_to_format , formatter ,
@@ -860,7 +860,7 @@ def _get_column_name_list(self):
860860
861861def format_array (values , formatter , float_format = None , na_rep = 'NaN' ,
862862 digits = None , space = None , justify = 'right' , decimal = '.' ,
863- leading_space = None ):
863+ leading_space = 'compat' ):
864864 """
865865 Format an array for printing.
866866
@@ -874,7 +874,7 @@ def format_array(values, formatter, float_format=None, na_rep='NaN',
874874 space
875875 justify
876876 decimal
877- leading_space : bool, optional
877+ leading_space : bool, default is 'compat'
878878 Whether the array should be formatted with a leading space.
879879 When an array as a column of a Series or DataFrame, we do want
880880 the leading space to pad between columns.
@@ -924,7 +924,7 @@ class GenericArrayFormatter(object):
924924
925925 def __init__ (self , values , digits = 7 , formatter = None , na_rep = 'NaN' ,
926926 space = 12 , float_format = None , justify = 'right' , decimal = '.' ,
927- quoting = None , fixed_width = True , leading_space = None ):
927+ quoting = None , fixed_width = True , leading_space = 'compat' ):
928928 self .values = values
929929 self .digits = digits
930930 self .na_rep = na_rep
@@ -976,12 +976,12 @@ def _format(x):
976976
977977 is_float_type = lib .map_infer (vals , is_float ) & notna (vals )
978978 leading_space = self .leading_space
979- if leading_space is None :
979+ if leading_space == 'compat' :
980980 leading_space = is_float_type .any ()
981981
982982 fmt_values = []
983983 for i , v in enumerate (vals ):
984- if not is_float_type [i ] and leading_space :
984+ if not is_float_type [i ] and leading_space is True :
985985 fmt_values .append (u' {v}' .format (v = _format (v )))
986986 elif is_float_type [i ]:
987987 fmt_values .append (float_format (v ))
0 commit comments