MCPcopy
hub / github.com/pandas-dev/pandas / test_multi_columns

Function test_multi_columns

pandas/tests/frame/methods/test_explode.py:266–278  ·  view source on GitHub ↗
(input_subset, expected_dict, expected_index)

Source from the content-addressed store, hash-verified

264 ],
265)
266def test_multi_columns(input_subset, expected_dict, expected_index):
267 # GH 39240
268 df = pd.DataFrame(
269 {
270 "A": [[0, 1, 2], np.nan, [], (3, 4), np.nan],
271 "B": 1,
272 "C": [["a", "b", "c"], "foo", [], ["d", "e"], np.nan],
273 },
274 index=list("abcde"),
275 )
276 result = df.explode(input_subset)
277 expected = pd.DataFrame(expected_dict, expected_index)
278 tm.assert_frame_equal(result, expected)
279
280
281def test_multi_columns_nan_empty():

Callers

nothing calls this directly

Calls 1

explodeMethod · 0.95

Tested by

no test coverage detected