Skip to content

Commit ab5764e

Browse files
fangchenliyeshsurya
authored andcommitted
COMPAT: float() exception type for py310 (pandas-dev#41230)
1 parent a452099 commit ab5764e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/nanops.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@ def _ensure_numeric(x):
15981598
elif not (is_float(x) or is_integer(x) or is_complex(x)):
15991599
try:
16001600
x = float(x)
1601-
except ValueError:
1601+
except (TypeError, ValueError):
16021602
# e.g. "1+1j" or "foo"
16031603
try:
16041604
x = complex(x)

0 commit comments

Comments
 (0)