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

Function test_repeat

pandas/tests/strings/test_strings.py:122–135  ·  view source on GitHub ↗
(any_string_dtype)

Source from the content-addressed store, hash-verified

120
121
122def test_repeat(any_string_dtype):
123 ser = Series(["a", "b", np.nan, "c", np.nan, "d"], dtype=any_string_dtype)
124
125 result = ser.str.repeat(3)
126 expected = Series(
127 ["aaa", "bbb", np.nan, "ccc", np.nan, "ddd"], dtype=any_string_dtype
128 )
129 tm.assert_series_equal(result, expected)
130
131 result = ser.str.repeat([1, 2, 3, 4, 5, 6])
132 expected = Series(
133 ["a", "bb", np.nan, "cccc", np.nan, "dddddd"], dtype=any_string_dtype
134 )
135 tm.assert_series_equal(result, expected)
136
137
138def test_repeat_mixed_object():

Callers

nothing calls this directly

Calls 2

SeriesClass · 0.90
repeatMethod · 0.45

Tested by

no test coverage detected