@@ -3320,7 +3320,8 @@ def casefold(self):
3320
3320
3321
3321
This is equivalent to running the Python string method
3322
3322
:meth:`str.%(method)s` for each element of the Series/Index. If a string
3323
- has zero characters, ``False`` is returned for that check.
3323
+ has zero characters, ``False`` is returned for that check
3324
+ except for the `isascii` method.
3324
3325
3325
3326
Returns
3326
3327
-------
@@ -3333,6 +3334,7 @@ def casefold(self):
3333
3334
Series.str.isalpha : Check whether all characters are alphabetic.
3334
3335
Series.str.isnumeric : Check whether all characters are numeric.
3335
3336
Series.str.isalnum : Check whether all characters are alphanumeric.
3337
+ Series.str.isascii : Check whether all characters are ASCII characters.
3336
3338
Series.str.isdigit : Check whether all characters are digits.
3337
3339
Series.str.isdecimal : Check whether all characters are decimal.
3338
3340
Series.str.isspace : Check whether all characters are whitespace.
@@ -3367,6 +3369,13 @@ def casefold(self):
3367
3369
3 False
3368
3370
dtype: bool
3369
3371
3372
+ >>> s1.str.isascii()
3373
+ 0 True
3374
+ 1 True
3375
+ 2 True
3376
+ 3 True
3377
+ dtype: bool
3378
+
3370
3379
Note that checks against characters mixed with any additional punctuation
3371
3380
or whitespace will evaluate to false for an alphanumeric check.
3372
3381
@@ -3457,6 +3466,7 @@ def casefold(self):
3457
3466
"""
3458
3467
_doc_args ["isalnum" ] = {"type" : "alphanumeric" , "method" : "isalnum" }
3459
3468
_doc_args ["isalpha" ] = {"type" : "alphabetic" , "method" : "isalpha" }
3469
+ _doc_args ["isascii" ] = {"type" : "ASCII characters" , "method" : "isascii" }
3460
3470
_doc_args ["isdigit" ] = {"type" : "digits" , "method" : "isdigit" }
3461
3471
_doc_args ["isspace" ] = {"type" : "whitespace" , "method" : "isspace" }
3462
3472
_doc_args ["islower" ] = {"type" : "lowercase" , "method" : "islower" }
@@ -3472,6 +3482,9 @@ def casefold(self):
3472
3482
isalpha = _map_and_wrap (
3473
3483
"isalpha" , docstring = _shared_docs ["ismethods" ] % _doc_args ["isalpha" ]
3474
3484
)
3485
+ isascii = _map_and_wrap (
3486
+ "isascii" , docstring = _shared_docs ["ismethods" ] % _doc_args ["isascii" ]
3487
+ )
3475
3488
isdigit = _map_and_wrap (
3476
3489
"isdigit" , docstring = _shared_docs ["ismethods" ] % _doc_args ["isdigit" ]
3477
3490
)
0 commit comments