We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b26a7d commit a625520Copy full SHA for a625520
pandas/core/methods/corr.py
@@ -8,6 +8,8 @@
8
9
import numpy as np
10
11
+from pandas.core.dtypes.dtypes import CategoricalDtype
12
+
13
if TYPE_CHECKING:
14
from pandas import DataFrame
15
@@ -21,7 +23,7 @@ def transform_ord_cat_cols_to_coded_cols(df: DataFrame) -> DataFrame:
21
23
result = df
22
24
made_copy = False
25
for idx, dtype in enumerate(df.dtypes):
- if not dtype == "category" or not dtype.ordered: # type: ignore[attr-defined]
26
+ if not isinstance(dtype, CategoricalDtype) or not dtype.ordered:
27
continue
28
col = result._ixs(idx, axis=1)
29
if not made_copy:
0 commit comments