Skip to content

Commit e8c791f

Browse files
Abby VeCaseyAbby VeCasey
authored andcommitted
ascii3
1 parent dc3f2e9 commit e8c791f

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

pandas/core/arrays/_arrow_string_mixins.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,19 @@ def _str_isascii(self):
268268
# for s in self.to_pylist()
269269
# ]
270270

271-
def _str_isascii(self):
272-
pylist = [
273-
s.isascii() if isinstance(s, str) else None
274-
for s in self._pa_array.to_pylist()
275-
]
271+
# def _str_isascii(self):
272+
# pylist = [
273+
# s.isascii() if isinstance(s, str) else None
274+
# for s in self._pa_array.to_pylist()
275+
# ]
276276

277-
result = pa.array(pylist, type=pa.bool_())
277+
# result = pa.array(pylist, type=pa.bool_())
278+
# return self._convert_bool_result(result)
279+
280+
def _str_isascii(self):
281+
result = all(ord(char) < 128 for char in self)
278282
return self._convert_bool_result(result)
279-
283+
280284
def _str_isdecimal(self):
281285
result = pc.utf8_is_decimal(self._pa_array)
282286
return self._convert_bool_result(result)

0 commit comments

Comments
 (0)