We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74fb4f9 commit a1da54eCopy full SHA for a1da54e
pandas/core/arrays/_arrow_string_mixins.py
@@ -203,6 +203,8 @@ def _str_swapcase(self) -> Self:
203
return self._from_pyarrow_array(pc.utf8_swapcase(self._pa_array))
204
205
def _str_removeprefix(self, prefix: str):
206
+ if prefix == "":
207
+ return self
208
starts_with = pc.starts_with(self._pa_array, pattern=prefix)
209
removed = pc.utf8_slice_codeunits(self._pa_array, len(prefix))
210
result = pc.if_else(starts_with, removed, self._pa_array)
0 commit comments