Skip to content

Commit

Permalink
Merge 72f6b9e into 0c5e6c2
Browse files Browse the repository at this point in the history
  • Loading branch information
josef-pkt committed Aug 15, 2014
2 parents 0c5e6c2 + 72f6b9e commit 578ee9f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion statsmodels/tools/grouputils.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,12 @@ def labels(self):
# Compat code for the labels -> codes change in pandas 0.15
# FIXME: use .codes directly when we don't want to support pandas < 0.15
tmp = pd.Categorical(self.index)
return getattr(tmp, "codes", tmp.labels)[None]
try:
labl = tmp.labels
except AttributeError:
labl = tmp.codes

return labl[None]


@property
Expand Down

0 comments on commit 578ee9f

Please sign in to comment.