Skip to content

Commit e756c7e

Browse files
committed
Add test for single-element list and index case
1 parent 29d9519 commit e756c7e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/series/test_constructors.py

+8
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,14 @@ def test_constructor_numpy_scalar(self):
422422
expected = Series(100, index=np.arange(4), dtype='int64')
423423
tm.assert_series_equal(result, expected)
424424

425+
def test_constructor_broadcast_list(self):
426+
# GH 19342
427+
# construction with single-element container and index
428+
# should not raise
429+
result = Series(['foo'], index=['a', 'b', 'c'])
430+
expected = Series(['foo'] * 3, index=['a', 'b', 'c'])
431+
tm.assert_series_equal(result, expected)
432+
425433
def test_constructor_corner(self):
426434
df = tm.makeTimeDataFrame()
427435
objs = [df, df]

0 commit comments

Comments
 (0)