chevron_left
Char
Method addMethod capitalizeMethod centerMethod countMethod endswithMethod equalMethod expandtabsMethod findMethod greaterMethod greater_equalMethod indexMethod isalnumMethod isalphaMethod isdecimalMethod isdigitMethod isnumericMethod isupperMethod joinMethod lessMethod less_equalMethod ljustMethod lowerMethod multiplyMethod not_equalMethod rfindMethod rjustMethod rstripMethod splitMethod splitlinesMethod startswithMethod upperMethod zfill
0
0
0
new
NumPy | isdecimal method
Programming
chevron_rightPython
chevron_rightNumPy
chevron_rightDocumentation
chevron_rightChar
schedule Mar 10, 2022
Last updated Python●NumPy
Tags tocTable of Contents
expand_more Numpy's isdecimal(~)
method checks whether each string of the input array is a decimal character.
WARNING
Numbers with dots do not qualify as numeric
For instance, "2"
qualifies as a digit, but "2.5"
with a dot does not.
Parameters
1. a
| array-like
The input array.
Return value
If a
is a scalar, then a single boolean is returned. Otherwise, a Numpy array of booleans is returned.
Examples
np.char.isdecimal(["2.5", "", "3", "0"],)
array([False, False, True, True])
Notice how "2.5"
, which does represent a number, returned False.
Published by Isshin Inada
Edited by 0 others
Did you find this page useful?
Ask a question or leave a feedback...