We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb965e7 commit 4bf8a07Copy full SHA for 4bf8a07
pandas/tests/libs/test_lib.py
@@ -297,3 +297,15 @@ def test_ensure_string_array_copy():
297
assert not np.shares_memory(arr, result)
298
assert arr[1] is None
299
assert result[1] is np.nan
300
+
301
302
+def test_ensure_string_array_list_of_lists():
303
+ # GH#61155: ensure list of lists doesn't get converted to string
304
+ arr = [list("test"), list("word")]
305
+ result = lib.ensure_string_array(arr)
306
307
+ # Each item in result should still be a list, not a stringified version
308
+ assert isinstance(result, np.ndarray)
309
+ assert result.dtype == object
310
+ assert result[0] == "['t', 'e', 's', 't']"
311
+ assert result[1] == "['w', 'o', 'r', 'd']"
0 commit comments