Skip to content

Commit 80d4cff

Browse files
committed
Simplify removeprefix and find
1 parent 6ffc7a9 commit 80d4cff

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pandas/core/arrays/string_arrow.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ def astype(self, dtype, copy: bool = True):
342342
_str_lstrip = ArrowStringArrayMixin._str_lstrip
343343
_str_rstrip = ArrowStringArrayMixin._str_rstrip
344344
_str_removesuffix = ArrowStringArrayMixin._str_removesuffix
345+
_str_removeprefix = ArrowStringArrayMixin._str_removeprefix
346+
_str_find = ArrowStringArrayMixin._str_find
345347
_str_get = ArrowStringArrayMixin._str_get
346348
_str_capitalize = ArrowStringArrayMixin._str_capitalize
347349
_str_title = ArrowStringArrayMixin._str_title
@@ -438,18 +440,12 @@ def _str_repeat(self, repeats: int | Sequence[int]):
438440
else:
439441
return ArrowExtensionArray._str_repeat(self, repeats=repeats)
440442

441-
def _str_removeprefix(self, prefix: str):
442-
return ArrowStringArrayMixin._str_removeprefix(self, prefix)
443-
444443
def _str_count(self, pat: str, flags: int = 0):
445444
if flags:
446445
return super()._str_count(pat, flags)
447446
result = pc.count_substring_regex(self._pa_array, pat)
448447
return self._convert_int_result(result)
449448

450-
def _str_find(self, sub: str, start: int = 0, end: int | None = None):
451-
return ArrowStringArrayMixin._str_find(self, sub, start, end)
452-
453449
def _str_get_dummies(self, sep: str = "|", dtype: NpDtype | None = None):
454450
if dtype is None:
455451
dtype = np.int64

0 commit comments

Comments
 (0)