Skip to content

Commit

Permalink
ascii3
Browse files Browse the repository at this point in the history
  • Loading branch information
Abby VeCasey authored and Abby VeCasey committed Dec 9, 2024
1 parent dc3f2e9 commit e8c791f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions pandas/core/arrays/_arrow_string_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,19 @@ def _str_isascii(self):
# for s in self.to_pylist()
# ]

def _str_isascii(self):
pylist = [
s.isascii() if isinstance(s, str) else None
for s in self._pa_array.to_pylist()
]
# def _str_isascii(self):
# pylist = [
# s.isascii() if isinstance(s, str) else None
# for s in self._pa_array.to_pylist()
# ]

result = pa.array(pylist, type=pa.bool_())
# result = pa.array(pylist, type=pa.bool_())
# return self._convert_bool_result(result)

def _str_isascii(self):
result = all(ord(char) < 128 for char in self)
return self._convert_bool_result(result)

def _str_isdecimal(self):
result = pc.utf8_is_decimal(self._pa_array)
return self._convert_bool_result(result)
Expand Down

0 comments on commit e8c791f

Please sign in to comment.