Skip to content

Commit 066da75

Browse files
Revert "is type refactor (#46119)"
This reverts commit 541bbf9.
1 parent f99ec8b commit 066da75

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

pandas/io/formats/style_render.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
from pandas._typing import Level
2626
from pandas.compat._optional import import_optional_dependency
2727

28-
from pandas.core.dtypes.common import (
29-
is_complex,
30-
is_float,
31-
is_integer,
32-
)
3328
from pandas.core.dtypes.generic import ABCSeries
3429

3530
from pandas import (
@@ -1532,9 +1527,9 @@ def _default_formatter(x: Any, precision: int, thousands: bool = False) -> Any:
15321527
value : Any
15331528
Matches input type, or string if input is float or complex or int with sep.
15341529
"""
1535-
if is_float(x) or is_complex(x):
1530+
if isinstance(x, (float, complex)):
15361531
return f"{x:,.{precision}f}" if thousands else f"{x:.{precision}f}"
1537-
elif is_integer(x):
1532+
elif isinstance(x, int):
15381533
return f"{x:,.0f}" if thousands else f"{x:.0f}"
15391534
return x
15401535

@@ -1549,7 +1544,7 @@ def _wrap_decimal_thousands(
15491544
"""
15501545

15511546
def wrapper(x):
1552-
if is_float(x) or is_integer(x) or is_complex(x):
1547+
if isinstance(x, (float, complex, int)):
15531548
if decimal != "." and thousands is not None and thousands != ",":
15541549
return (
15551550
formatter(x)

0 commit comments

Comments
 (0)