Skip to content

Commit

Permalink
TST: sparse display repr on windows, xref pandas-dev#12779
Browse files Browse the repository at this point in the history
  • Loading branch information
jreback committed Apr 3, 2016
1 parent c2a481f commit a6b1a22
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pandas/tests/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
from distutils.version import LooseVersion
import re

from pandas.compat import range, zip, lrange, StringIO, PY3, lzip, u
from pandas.compat import (range, zip, lrange, StringIO, PY3,
u, lzip, is_platform_windows)
import pandas.compat as compat
import itertools
from operator import methodcaller
Expand Down Expand Up @@ -3714,19 +3715,20 @@ def test_to_string_header(self):
def test_sparse_max_row(self):
s = pd.Series([1, np.nan, np.nan, 3, np.nan]).to_sparse()
result = repr(s)
dtype = '' if is_platform_windows() else ', dtype=int32'
exp = ("0 1.0\n1 NaN\n2 NaN\n3 3.0\n"
"4 NaN\ndtype: float64\nBlockIndex\n"
"Block locations: array([0, 3], dtype=int32)\n"
"Block lengths: array([1, 1], dtype=int32)")
"Block locations: array([0, 3]{0})\n"
"Block lengths: array([1, 1]{0})".format(dtype))
self.assertEqual(result, exp)

with option_context("display.max_rows", 3):
# GH 10560
result = repr(s)
exp = ("0 1.0\n ... \n4 NaN\n"
"dtype: float64\nBlockIndex\n"
"Block locations: array([0, 3], dtype=int32)\n"
"Block lengths: array([1, 1], dtype=int32)")
"Block locations: array([0, 3]{0})\n"
"Block lengths: array([1, 1]{0})".format(dtype))
self.assertEqual(result, exp)


Expand Down

0 comments on commit a6b1a22

Please sign in to comment.