-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: CategoricalIndex.get_indexer does not detect duplicates #38556
Comments
try on 1.2.0rc0 / master lots of things have been fixed |
After some searching I found the instructions for installing a pre-release version on https://github.com/pandas-dev/pandas/releases. The problem still exists in INSTALLED VERSIONScommit : 7688d3c pandas : 1.2.0rc0 |
but is fixed on master |
As far as I can tell, based on the above, this can be closed, but please do ping me if my assessment is wrong |
Problem description
CategoricalIndex.get_indexer
should fail if the index contains duplicates, just like the regular index does. Instead, it returns a nonsense array that does not even have the same length as the target.Note this problem also affects the case where dtypes are equal or the target is not categorical i.e.:
I fixed a related bug in Sep 2019 as #28257 but that fix was merged in v1.0.0 so this must be a seperate issue or a regression. Could also be related to #25459.
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : b5958ee
python : 3.8.5.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.18362
machine : AMD64
processor : Intel64 Family 6 Model 85 Stepping 7, GenuineIntel
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : English_United Kingdom.1252
pandas : 1.1.5
numpy : 1.19.2
pytz : 2020.4
dateutil : 2.8.1
pip : 20.3.3
setuptools : 51.0.0.post20201207
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: