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 d5eab1b commit 200c336Copy full SHA for 200c336
pandas/core/arrays/categorical.py
@@ -2233,8 +2233,14 @@ def _repr_categories(self) -> list[str]:
2233
)
2234
from pandas.io.formats import format as fmt
2235
2236
+ formatter = None
2237
+ if self.categories.dtype == "str":
2238
+ # the extension array formatter defaults to boxed=True in format_array
2239
+ # override here to boxed=False to be consistent with QUOTE_NONNUMERIC
2240
+ formatter = self.categories._values._formatter(boxed=False)
2241
+
2242
format_array = partial(
- fmt.format_array, formatter=None, quoting=QUOTE_NONNUMERIC
2243
+ fmt.format_array, formatter=formatter, quoting=QUOTE_NONNUMERIC
2244
2245
if len(self.categories) > max_categories:
2246
num = max_categories // 2
0 commit comments