Fix: Add compat code for pd.Categorical in pandas>=0.15 #1884

Merged
merged 1 commit into from Aug 14, 2014

Projects

None yet

3 participants

@janschulz
Contributor

No description provided.

@janschulz janschulz Fix: Add compat code for pd.Categorical in pandas>=0.15
83be7a5
@janschulz janschulz referenced this pull request in pandas-dev/pandas Aug 14, 2014
Merged

CLN/DOC/TST: Categorical fixups (GH7768) #8007

@coveralls

Coverage Status

Coverage increased (+0.0%) when pulling 83be7a5 on JanSchulz:cat_fixes into 20c59d2 on statsmodels:master.

@josef-pkt
Member

Thanks @JanSchulz

Merging, looks good from what I understand.

result should be visible on pythonxy Ubuntu testing
I don't find a related issue that should be closed

@josef-pkt josef-pkt merged commit 53dccdd into statsmodels:master Aug 14, 2014

2 checks passed

continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci The Travis CI build passed
Details
@josef-pkt
Member

didn't work, still raises error

https://launchpadlibrarian.net/182311320/buildlog_ubuntu-utopic-i386.statsmodels_0.6.0~ppa18~revno-1690~ubuntu14.10.1_UPLOADING.txt.gz

======================================================================
ERROR: statsmodels.tools.tests.test_grouputils.TestIndexGrouping.test_count_categories
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/build/buildd/statsmodels-0.6.0~ppa18~revno/debian/python-statsmodels/usr/lib/python2.7/dist-packages/statsmodels/tools/tests/test_grouputils.py", line 16, in test_count_categories
    self.grouping.count_categories(level=0)
  File "/build/buildd/statsmodels-0.6.0~ppa18~revno/debian/python-statsmodels/usr/lib/python2.7/dist-packages/statsmodels/tools/grouputils.py", line 415, in count_categories
    self.counts = np.bincount(self.labels[level])
  File "/build/buildd/statsmodels-0.6.0~ppa18~revno/debian/python-statsmodels/usr/lib/python2.7/dist-packages/statsmodels/tools/grouputils.py", line 377, in labels
    return getattr(tmp, "codes", tmp.labels)[None]
AttributeError: 'Categorical' object has no attribute 'labels'
@josef-pkt josef-pkt removed the PR label Aug 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment