|
7 | 7 | from distutils.version import LooseVersion
|
8 | 8 | import re
|
9 | 9 |
|
10 |
| -from pandas.compat import range, zip, lrange, StringIO, PY3, lzip, u |
| 10 | +from pandas.compat import (range, zip, lrange, StringIO, PY3, |
| 11 | + u, lzip, is_platform_windows) |
11 | 12 | import pandas.compat as compat
|
12 | 13 | import itertools
|
13 | 14 | from operator import methodcaller
|
@@ -3714,19 +3715,20 @@ def test_to_string_header(self):
|
3714 | 3715 | def test_sparse_max_row(self):
|
3715 | 3716 | s = pd.Series([1, np.nan, np.nan, 3, np.nan]).to_sparse()
|
3716 | 3717 | result = repr(s)
|
| 3718 | + dtype = '' if is_platform_windows() else ', dtype=int32' |
3717 | 3719 | exp = ("0 1.0\n1 NaN\n2 NaN\n3 3.0\n"
|
3718 | 3720 | "4 NaN\ndtype: float64\nBlockIndex\n"
|
3719 |
| - "Block locations: array([0, 3], dtype=int32)\n" |
3720 |
| - "Block lengths: array([1, 1], dtype=int32)") |
| 3721 | + "Block locations: array([0, 3]{0})\n" |
| 3722 | + "Block lengths: array([1, 1]{0})".format(dtype)) |
3721 | 3723 | self.assertEqual(result, exp)
|
3722 | 3724 |
|
3723 | 3725 | with option_context("display.max_rows", 3):
|
3724 | 3726 | # GH 10560
|
3725 | 3727 | result = repr(s)
|
3726 | 3728 | exp = ("0 1.0\n ... \n4 NaN\n"
|
3727 | 3729 | "dtype: float64\nBlockIndex\n"
|
3728 |
| - "Block locations: array([0, 3], dtype=int32)\n" |
3729 |
| - "Block lengths: array([1, 1], dtype=int32)") |
| 3730 | + "Block locations: array([0, 3]{0})\n" |
| 3731 | + "Block lengths: array([1, 1]{0})".format(dtype)) |
3730 | 3732 | self.assertEqual(result, exp)
|
3731 | 3733 |
|
3732 | 3734 |
|
|
0 commit comments