(self, repeats: int | Sequence[int])
| 196 | return self._str_map(f, dtype=str) |
| 197 | |
| 198 | def _str_repeat(self, repeats: int | Sequence[int]): |
| 199 | if lib.is_integer(repeats): |
| 200 | rint = cast(int, repeats) |
| 201 | |
| 202 | def scalar_rep(x): |
| 203 | try: |
| 204 | return bytes.__mul__(x, rint) |
| 205 | except TypeError: |
| 206 | return str.__mul__(x, rint) |
| 207 | |
| 208 | return self._str_map(scalar_rep, dtype=str) |
| 209 | else: |
| 210 | from pandas.core.arrays.string_ import BaseStringArray |
| 211 | |
| 212 | def rep(x, r): |
| 213 | if x is libmissing.NA: |
| 214 | return x |
| 215 | try: |
| 216 | return bytes.__mul__(x, r) |
| 217 | except TypeError: |
| 218 | return str.__mul__(x, r) |
| 219 | |
| 220 | result = libops.vec_binop( |
| 221 | np.asarray(self), |
| 222 | np.asarray(repeats, dtype=object), |
| 223 | rep, |
| 224 | ) |
| 225 | if not isinstance(self, BaseStringArray): |
| 226 | return result |
| 227 | # Not going through map, so we have to do this here. |
| 228 | return type(self)._from_sequence(result, dtype=self.dtype) |
| 229 | |
| 230 | def _str_match( |
| 231 | self, |
no test coverage detected