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

Function test_get_complex

pandas/tests/strings/test_split_partition.py:746–752  ·  view source on GitHub ↗
(idx, exp)

Source from the content-addressed store, hash-verified

744 "idx, exp", [[2, [3, 3, np.nan, "b"]], [-1, [3, 3, np.nan, np.nan]]]
745)
746def test_get_complex(idx, exp):
747 # GH 20671, getting value not in dict raising `KeyError`
748 ser = Series([(1, 2, 3), [1, 2, 3], {1, 2, 3}, {1: "a", 2: "b", 3: "c"}])
749
750 result = ser.str.get(idx)
751 expected = Series(exp)
752 tm.assert_series_equal(result, expected)
753
754
755@pytest.mark.parametrize("to_type", [tuple, list, np.array])

Callers

nothing calls this directly

Calls 2

SeriesClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected