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

Function test_extractall_column_names

pandas/tests/strings/test_extract.py:491–501  ·  view source on GitHub ↗
(pat, expected_names, any_string_dtype)

Source from the content-addressed store, hash-verified

489 ],
490)
491def test_extractall_column_names(pat, expected_names, any_string_dtype):
492 s = Series(["", "A1", "32"], dtype=any_string_dtype)
493
494 result = s.str.extractall(pat)
495 expected = DataFrame(
496 [("A", "1"), (np.nan, "3"), (np.nan, "2")],
497 index=MultiIndex.from_tuples([(1, 0), (2, 0), (2, 1)], names=(None, "match")),
498 columns=expected_names,
499 dtype=any_string_dtype,
500 )
501 tm.assert_frame_equal(result, expected)
502
503
504def test_extractall_single_group(any_string_dtype):

Callers

nothing calls this directly

Calls 4

SeriesClass · 0.90
DataFrameClass · 0.90
extractallMethod · 0.80
from_tuplesMethod · 0.45

Tested by

no test coverage detected