From 4e40471bfe45c682523328cb7a40106c7b1b1e6a Mon Sep 17 00:00:00 2001 From: louis <@> Date: Sat, 2 Nov 2019 11:31:51 +0000 Subject: [PATCH 1/2] TST: Test Series constructor with dict containing lists and explicit dtype. --- pandas/tests/series/test_constructors.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pandas/tests/series/test_constructors.py b/pandas/tests/series/test_constructors.py index fb2a8dde96e2b..e28c8f029f784 100644 --- a/pandas/tests/series/test_constructors.py +++ b/pandas/tests/series/test_constructors.py @@ -1035,6 +1035,13 @@ def test_constructor_dict(self): expected.iloc[1] = 1 tm.assert_series_equal(result, expected) + def test_constructor_dict_list_value_explicit_dtype(self): + # GH 18625 + d = {'a': [[2], [3], [4]]} + result = Series(d, index=['a'], dtype="object") + expected = Series(d, index=['a']) + tm.assert_series_equal(result, expected) + def test_constructor_dict_order(self): # GH19018 # initialization ordering: by insertion order if python>= 3.6, else From ef10afc9de031e4bd3ca48136f855c7bfb91db9f Mon Sep 17 00:00:00 2001 From: louis <@> Date: Sat, 2 Nov 2019 12:16:37 +0000 Subject: [PATCH 2/2] Black formatting. --- pandas/tests/series/test_constructors.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/tests/series/test_constructors.py b/pandas/tests/series/test_constructors.py index e28c8f029f784..4cbade2669cc6 100644 --- a/pandas/tests/series/test_constructors.py +++ b/pandas/tests/series/test_constructors.py @@ -1037,9 +1037,9 @@ def test_constructor_dict(self): def test_constructor_dict_list_value_explicit_dtype(self): # GH 18625 - d = {'a': [[2], [3], [4]]} - result = Series(d, index=['a'], dtype="object") - expected = Series(d, index=['a']) + d = {"a": [[2], [3], [4]]} + result = Series(d, index=["a"], dtype="object") + expected = Series(d, index=["a"]) tm.assert_series_equal(result, expected) def test_constructor_dict_order(self):