File tree 3 files changed +7
-1
lines changed
3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -364,6 +364,7 @@ Bug Fixes
364
364
- Bug in ``DataFrame.replace() `` where changing a dtype through replacement
365
365
would only replace the first occurrence of a value (:issue: `6689 `)
366
366
- Better error message when passing a frequency of 'MS' in ``Period `` construction (GH5332)
367
+ - Bug in `Series.__unicode__ ` when `max_rows ` is `None ` and the Series has more than 1000 rows. (:issue: `6863 `)
367
368
368
369
pandas 0.13.1
369
370
-------------
Original file line number Diff line number Diff line change @@ -828,7 +828,7 @@ def __unicode__(self):
828
828
width , height = get_terminal_size ()
829
829
max_rows = (height if get_option ("display.max_rows" ) == 0
830
830
else get_option ("display.max_rows" ))
831
- if len (self .index ) > ( max_rows or 1000 ) :
831
+ if max_rows and len (self .index ) > max_rows :
832
832
result = self ._tidy_repr (min (30 , max_rows - 4 ))
833
833
elif len (self .index ) > 0 :
834
834
result = self ._get_repr (print_header = True ,
Original file line number Diff line number Diff line change @@ -1770,6 +1770,11 @@ def test_repr_should_return_str(self):
1770
1770
df = Series (data , index = index1 )
1771
1771
self .assertTrue (type (df .__repr__ () == str )) # both py2 / 3
1772
1772
1773
+ def test_repr_max_rows (self ):
1774
+ # GH 6863
1775
+ with pd .option_context ('max_rows' , None ):
1776
+ str (Series (range (1001 ))) # should not raise exception
1777
+
1773
1778
def test_unicode_string_with_unicode (self ):
1774
1779
df = Series ([u ("\u05d0 " )], name = u ("\u05d1 " ))
1775
1780
if compat .PY3 :
You can’t perform that action at this time.
0 commit comments