@@ -141,16 +141,16 @@ def test_repr_truncation(self):
141
141
def test_repr_chop_threshold (self ):
142
142
df = DataFrame ([[0.1 , 0.5 ],[0.5 , - 0.1 ]])
143
143
pd .reset_option ("display.chop_threshold" ) # default None
144
- self .assertEqual (repr (df ), ' 0 1\n 0 0.1 0.5\n 1 0.5 -0.1\n \n [2 rows x 2 columns] ' )
144
+ self .assertEqual (repr (df ), ' 0 1\n 0 0.1 0.5\n 1 0.5 -0.1' )
145
145
146
146
with option_context ("display.chop_threshold" , 0.2 ):
147
- self .assertEqual (repr (df ), ' 0 1\n 0 0.0 0.5\n 1 0.5 0.0\n \n [2 rows x 2 columns] ' )
147
+ self .assertEqual (repr (df ), ' 0 1\n 0 0.0 0.5\n 1 0.5 0.0' )
148
148
149
149
with option_context ("display.chop_threshold" , 0.6 ):
150
- self .assertEqual (repr (df ), ' 0 1\n 0 0 0\n 1 0 0\n \n [2 rows x 2 columns] ' )
150
+ self .assertEqual (repr (df ), ' 0 1\n 0 0 0\n 1 0 0' )
151
151
152
152
with option_context ("display.chop_threshold" , None ):
153
- self .assertEqual (repr (df ), ' 0 1\n 0 0.1 0.5\n 1 0.5 -0.1\n \n [2 rows x 2 columns] ' )
153
+ self .assertEqual (repr (df ), ' 0 1\n 0 0.1 0.5\n 1 0.5 -0.1' )
154
154
155
155
def test_repr_obeys_max_seq_limit (self ):
156
156
import pandas .core .common as com
@@ -197,7 +197,8 @@ def test_expand_frame_repr(self):
197
197
with option_context ('mode.sim_interactive' , True ):
198
198
with option_context ('display.max_columns' , 10 ,
199
199
'display.width' ,20 ,
200
- 'display.max_rows' , 20 ):
200
+ 'display.max_rows' , 20 ,
201
+ 'display.show_dimensions' , True ):
201
202
with option_context ('display.expand_frame_repr' , True ):
202
203
self .assertFalse (has_truncated_repr (df_small ))
203
204
self .assertFalse (has_expanded_repr (df_small ))
@@ -789,7 +790,7 @@ def test_pprint_thing(self):
789
790
self .assertTrue (not "\t " in pp_t ("a\t b" , escape_chars = ("\t " ,)))
790
791
791
792
def test_wide_repr (self ):
792
- with option_context ('mode.sim_interactive' , True ):
793
+ with option_context ('mode.sim_interactive' , True , 'display.show_dimensions' , True ):
793
794
col = lambda l , k : [tm .rands (k ) for _ in range (l )]
794
795
max_cols = get_option ('display.max_columns' )
795
796
df = DataFrame ([col (max_cols - 1 , 25 ) for _ in range (10 )])
@@ -812,7 +813,7 @@ def test_wide_repr_wide_columns(self):
812
813
df = DataFrame (randn (5 , 3 ), columns = ['a' * 90 , 'b' * 90 , 'c' * 90 ])
813
814
rep_str = repr (df )
814
815
815
- self .assertEqual (len (rep_str .splitlines ()), 22 )
816
+ self .assertEqual (len (rep_str .splitlines ()), 20 )
816
817
817
818
def test_wide_repr_named (self ):
818
819
with option_context ('mode.sim_interactive' , True ):
@@ -1458,6 +1459,7 @@ def test_repr_html(self):
1458
1459
self .reset_display_options ()
1459
1460
1460
1461
df = DataFrame ([[1 , 2 ], [3 , 4 ]])
1462
+ fmt .set_option ('display.show_dimensions' , True )
1461
1463
self .assertTrue ('2 rows' in df ._repr_html_ ())
1462
1464
fmt .set_option ('display.show_dimensions' , False )
1463
1465
self .assertFalse ('2 rows' in df ._repr_html_ ())
0 commit comments