-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: merging with mixed types objects in py3 when unorderable #12814
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
Comments
pls provide a minimal but complete copy-pastable example |
Weirdly the following trivial example does work:
So the problem must be with my data somehow. What's the best way to get my data into a trivial example? If I copy out strings I potentially lose datatypes and so forth. Will a pickled version of a few rows work? |
sure if you have a reproducible and you don't mind sharing then that would work. |
This is rather tricky to reproduce, but I had the same issue. Here is a minimal example that triggers it for me:
I had to try a lot of combinations to nail it down, and it seems that the following conditions are needed to trigger this:
Cheers,
|
you realized that doing The issue is mixed object indexes, not a good idea to have mixed types like this in the index ever (or in a column for that matter). Yes this does trigger an error. If you want to have a look, go for it.
|
1. Added an internal `safe_sort` to safely sort mixed-integer arrays in Python3. 2. Changed Index.difference and Index.symmetric_difference in order to: - sort mixed-int Indexes (pandas-dev#13432) - improve performance (pandas-dev#12044) 3. Fixed DataFrame.join which raised in Python3 with mixed-int non-unique indexes (issue with sorting mixed-ints, pandas-dev#12814) 4. Fixed Index.union returning an empty Index when one of arguments was a named empty Index (pandas-dev#13432)
Code Sample, a copy-pastable example if possible
Whatever my data looks like, a copy, minus some rows, merged (on indexes) with a copy should function without error, no?
Expected Output
\Anaconda3\lib\site-packages\pandas\tools\merge.py", line 535, in _get_join_indexers llab, rlab, shape = map(list, zip(* map(fkeys, left_keys, right_keys))) TypeError: type object argument after * must be a sequence, not map
output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 30 Stepping 5, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.0
setuptools: 20.2.2
Cython: 0.23.4
numpy: 1.10.4
scipy: 0.17.0
statsmodels: 0.6.1
xarray: None
IPython: 4.0.3
sphinx: 1.3.1
patsy: 0.4.0
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.4.6
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.8.4
lxml: 3.5.0
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.11
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.39.0
None
The text was updated successfully, but these errors were encountered: