-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
Can't combine DatetimeIndex MultiIndex with numeric MultiIndex #23478
Comments
@nackerley : Thanks reporting this! Admittedly, your use-cases seem a little unusual, but I am uncertain that we should be raising as you said. Let's get some more feedback before proceeding. |
Can't reproduce with master (although some different errors pop out under python 2). Might be related to #22072 (just a guess, can't check right now). |
Looks to be fixed on master. Could use a test
|
Hello! @mroeschke Shall I take this one and write a test for it? I'm looking for a good first issue as it's my first time contributing to this project. Any tips are welcome to help me jumpstart |
Yes go for it @VictoriaKfk. https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#test-driven-development-code-writing will help with testing guidelines |
Code Sample, a copy-pastable example if possible
Output
Problem description
I expect that you should be able to combine any MultiIndex of any type, as long as the number of levels matches. It turns out you can combine DatetimeIndex with str, but if you try to combine it with with int or float a baffling TypeError is raised.
At the moment the only workaround I can see is to convert numeric indices to strings.
Expected Output
Output of
pd.show_versions()
pandas: 0.23.4
pytest: 3.7.4
pip: 9.0.1
setuptools: 36.3.0
Cython: None
numpy: 1.14.2
scipy: 1.0.0
pyarrow: None
xarray: None
IPython: 6.1.0
sphinx: 1.6.3
patsy: 0.5.0
dateutil: 2.6.1
pytz: 2017.2
blosc: None
bottleneck: 1.2.1
tables: 3.4.4
numexpr: 2.6.4
feather: None
matplotlib: 2.2.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: 4.0.0
bs4: None
html5lib: 0.999999999
sqlalchemy: 1.1.13
pymysql: None
psycopg2: 2.7.5 (dt dec pq3 ext lo64)
jinja2: 2.9.6
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: