Skip to content

Commit bd25234

Browse files
committed
updated str_is_numeric(), allows floats
1 parent 6bcd303 commit bd25234

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pandas/core/strings/base.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Literal,
77
)
88

9-
from pandas._libs import lib
9+
#from pandas._libs import lib
1010

1111
if TYPE_CHECKING:
1212
from collections.abc import (
@@ -93,7 +93,7 @@ def _str_match(
9393
pat: str,
9494
case: bool = True,
9595
flags: int = 0,
96-
na: Scalar | lib.NoDefault = lib.no_default,
96+
#na: Scalar | lib.NoDefault = lib.no_default,
9797
):
9898
pass
9999

@@ -103,7 +103,7 @@ def _str_fullmatch(
103103
pat: str | re.Pattern,
104104
case: bool = True,
105105
flags: int = 0,
106-
na: Scalar | lib.NoDefault = lib.no_default,
106+
#na: Scalar | lib.NoDefault = lib.no_default,
107107
):
108108
pass
109109

@@ -197,7 +197,11 @@ def _str_islower(self):
197197

198198
@abc.abstractmethod
199199
def _str_isnumeric(self):
200-
pass
200+
try:
201+
float(self)
202+
return True
203+
except ValueError:
204+
return False
201205

202206
@abc.abstractmethod
203207
def _str_isspace(self):

0 commit comments

Comments
 (0)