Skip to content

Commit b817366

Browse files
authored
Update categorical.py
1 parent a4ba634 commit b817366

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/core/categorical.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,7 +2047,7 @@ class CategoricalAccessor(PandasDelegate, NoNewAttributesMixin):
20472047
20482048
"""
20492049

2050-
def __init__(self, name, values, index):
2050+
def __init__(self, values, index, name):
20512051
self.categorical = values
20522052
self.index = index
20532053
self.name = name
@@ -2076,8 +2076,8 @@ def _make_accessor(cls, data):
20762076
if not is_categorical_dtype(data.dtype):
20772077
raise AttributeError("Can only use .cat accessor with a "
20782078
"'category' dtype")
2079-
return CategoricalAccessor(getattr(data, 'name', None),
2080-
data.values, data.index)
2079+
return CategoricalAccessor(data.values, data.index,
2080+
getattr(data, 'name', None),)
20812081

20822082

20832083
CategoricalAccessor._add_delegate_accessors(delegate=Categorical,

0 commit comments

Comments
 (0)