File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -364,6 +364,7 @@ Bug Fixes
364364- Bug in ``DataFrame.replace() `` where changing a dtype through replacement
365365 would only replace the first occurrence of a value (:issue: `6689 `)
366366- 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 `)
367368
368369pandas 0.13.1
369370-------------
Original file line number Diff line number Diff line change @@ -828,7 +828,7 @@ def __unicode__(self):
828828 width , height = get_terminal_size ()
829829 max_rows = (height if get_option ("display.max_rows" ) == 0
830830 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 :
832832 result = self ._tidy_repr (min (30 , max_rows - 4 ))
833833 elif len (self .index ) > 0 :
834834 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):
17701770 df = Series (data , index = index1 )
17711771 self .assertTrue (type (df .__repr__ () == str )) # both py2 / 3
17721772
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+
17731778 def test_unicode_string_with_unicode (self ):
17741779 df = Series ([u ("\u05d0 " )], name = u ("\u05d1 " ))
17751780 if compat .PY3 :
You can’t perform that action at this time.
0 commit comments