Skip to content

Commit 3a3b674

Browse files
committed
wrong opeartor, CategoricalIndex
1 parent 5a37754 commit 3a3b674

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pandas/core/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5441,7 +5441,7 @@ def _dir_additions(self) -> Set[str]:
54415441
"""
54425442
additions = super()._dir_additions()
54435443
if self._info_axis._can_hold_strings:
5444-
additions &= self._info_axis._dir_additions_for_owner
5444+
additions.update(self._info_axis._dir_additions_for_owner)
54455445
return additions
54465446

54475447
# ----------------------------------------------------------------------

pandas/core/indexes/category.py

+4
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ class CategoricalIndex(ExtensionIndex, accessor.PandasDelegate):
161161

162162
_typ = "categoricalindex"
163163

164+
@property
165+
def _can_hold_strings(self) -> bool:
166+
return self.categories._can_hold_strings
167+
164168
codes: np.ndarray
165169
categories: Index
166170
_data: Categorical

0 commit comments

Comments
 (0)