Skip to content

Commit ad23226

Browse files
authored
TST: apply returns list (#52912)
1 parent c9dbb81 commit ad23226

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tests/apply/test_frame_apply.py

+7
Original file line numberDiff line numberDiff line change
@@ -1433,6 +1433,13 @@ def test_apply_on_empty_dataframe():
14331433
tm.assert_series_equal(result, expected)
14341434

14351435

1436+
def test_apply_return_list():
1437+
df = DataFrame({"a": [1, 2], "b": [2, 3]})
1438+
result = df.apply(lambda x: [x.values])
1439+
expected = DataFrame({"a": [[1, 2]], "b": [[2, 3]]})
1440+
tm.assert_frame_equal(result, expected)
1441+
1442+
14361443
@pytest.mark.parametrize(
14371444
"test, constant",
14381445
[

0 commit comments

Comments
 (0)