Skip to content

Commit c1db8d6

Browse files
committed
test for nested
1 parent d6a539b commit c1db8d6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/series/test_explode.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ def test_empty():
3838
tm.assert_series_equal(result, expected)
3939

4040

41+
def test_nested_lists():
42+
s = pd.Series([[[1, 2, 3]], [1, 2], 1])
43+
result = s.explode()
44+
expected = pd.Series([[1, 2, 3], 1, 2, 1],
45+
index=[0, 1, 1, 2])
46+
tm.assert_series_equal(result, expected)
47+
48+
4149
def test_multi_index():
4250
s = pd.Series(
4351
[[0, 1, 2], np.nan, [], (3, 4)],

0 commit comments

Comments
 (0)