From ec6ab0ce848a920456490170920b7000ffddcb8c Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Wed, 12 Jul 2017 11:57:52 -0500 Subject: [PATCH] infer_dtypes --- pandas/tests/dtypes/test_cast.py | 4 ++-- pandas/tests/frame/test_indexing.py | 15 ++++++++------- pandas/tests/indexing/test_coercion.py | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pandas/tests/dtypes/test_cast.py b/pandas/tests/dtypes/test_cast.py index 3434357e6f0187..eb3aec6032a2fb 100644 --- a/pandas/tests/dtypes/test_cast.py +++ b/pandas/tests/dtypes/test_cast.py @@ -170,11 +170,11 @@ def testinfer_dtype_from_scalar(self): (1, np.int_, False), (1.5, np.float_, False), ([1], np.int_, False), - (np.array([1]), np.int_, False), + (np.array([1], dtype=np.int64), np.int64, False), ([np.nan, 1, ''], np.object_, False), (np.array([[1.0, 2.0]]), np.float_, False), (pd.Categorical(list('aabc')), np.object_, False), - (pd.Categorical([1, 2, 3]), np.int_, False), + (pd.Categorical([1, 2, 3]), np.int64, False), (pd.Categorical(list('aabc')), 'category', True), (pd.Categorical([1, 2, 3]), 'category', True), (Timestamp('20160101'), np.object_, False), diff --git a/pandas/tests/frame/test_indexing.py b/pandas/tests/frame/test_indexing.py index c1b7e8f0c5f5dc..03994a2f49cb1a 100644 --- a/pandas/tests/frame/test_indexing.py +++ b/pandas/tests/frame/test_indexing.py @@ -2724,17 +2724,18 @@ def test_where_axis(self): assert_frame_equal(result, expected) # Multiple dtypes (=> multiple Blocks) - df = pd.concat([DataFrame(np.random.randn(10, 2)), - DataFrame(np.random.randint(0, 10, size=(10, 2)))], - ignore_index=True, axis=1) + df = pd.concat([ + DataFrame(np.random.randn(10, 2)), + DataFrame(np.random.randint(0, 10, size=(10, 2), dtype='int64'))], + ignore_index=True, axis=1) mask = DataFrame(False, columns=df.columns, index=df.index) s1 = Series(1, index=df.columns) s2 = Series(2, index=df.index) result = df.where(mask, s1, axis='columns') expected = DataFrame(1.0, columns=df.columns, index=df.index) - expected[2] = expected[2].astype(int) - expected[3] = expected[3].astype(int) + expected[2] = expected[2].astype('int64') + expected[3] = expected[3].astype('int64') assert_frame_equal(result, expected) result = df.copy() @@ -2743,8 +2744,8 @@ def test_where_axis(self): result = df.where(mask, s2, axis='index') expected = DataFrame(2.0, columns=df.columns, index=df.index) - expected[2] = expected[2].astype(int) - expected[3] = expected[3].astype(int) + expected[2] = expected[2].astype('int64') + expected[3] = expected[3].astype('int64') assert_frame_equal(result, expected) result = df.copy() diff --git a/pandas/tests/indexing/test_coercion.py b/pandas/tests/indexing/test_coercion.py index e896313a12c9b6..752d2deb533043 100644 --- a/pandas/tests/indexing/test_coercion.py +++ b/pandas/tests/indexing/test_coercion.py @@ -1242,8 +1242,8 @@ def _assert_replace_conversion(self, from_key, to_key, how): (from_key == 'complex128' and to_key in ('int64', 'float64'))): - # buggy on 32-bit - if tm.is_platform_32bit(): + # buggy on 32-bit / window + if compat.is_platform_32bit() or compat.is_platform_windows(): pytest.skip("32-bit platform buggy: {0} -> {1}".format (from_key, to_key))