A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/9469 below:

Categorical[idx].codes != Categorical.codes[idx] · Issue #9469 · pandas-dev/pandas · GitHub

I'm unable to isolate this, but maybe this rings a bell for someone. It took me a long time to find the source of error in my code. I don't think this is intentional, and if so, is pretty dangerous.

[~/]
[22]: y[idx].codes[:15]
[22]: array([4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 4], dtype=int8)

[~/]
[23]: y.codes[idx][:15]
[23]: array([4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], dtype=int8)

[~/]
[24]: idx[:15]
[24]:
array([ 74172,  53885, 128953,  28125, 136548, 136700,  93633,  61147,
        56535,  90577, 115719,  58038, 111711,  53399,  77475])

[~/]
[25]: type(y)
[25]: pandas.core.categorical.Categorical

[~/]
[27]: pd.version.version
[27]: '0.15.2'

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4