-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG in MultiIndex truncated repr with integer level names #15262
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 show a copy-pastable example that doesn't rely on opening your file |
Sorry, I didn't manage to find a simple reproducible example. PS : It's only a 22Kb file |
this is not reproducible. you can try |
I could reproduce it but |
@KevinBaudin The file is not available anymore? |
@jorisvandenbossche edited with new link, sorry. |
@KevinBaudin The cause of the issue are the index level names ([1, 2]). If you set those to something else, you will see that the issue is resolved:
The reason for this is the integer level names (confusion between integer number of first (0) or second (1) level, or the level names (1 and 2)). |
Smaller reproducible example:
So it is the truncated repr that has this issue. |
@jorisvandenbossche ❤️ 👍 |
I've started looking at this. Seems to be an issue in
That last result is incorrect. Should the name of this issue be changed? (@jorisvandenbossche) |
I think this is a dupe of: #12223 if this is the case, just use an example from there as well in tests. |
…n MultiIndex closes pandas-dev#12223 closes pandas-dev#15262 Author: Dr-Irv <[email protected]> Closes pandas-dev#15478 from Dr-Irv/Issue15262 and squashes the following commits: 15d8433 [Dr-Irv] Address jreback comments 10667a3 [Dr-Irv] Fix types for test 8935068 [Dr-Irv] resolve conflicts 385ca3e [Dr-Irv] BUG: GH pandas-dev#12223, GH pandas-dev#15262. Allow ints for names in MultiIndex
Reproducible example:
So the truncated repr shows incorrectly the first index level (with integer level name
1
) again for the second level.Original post:
Code Sample, a copy-pastable example if possible
Problem description
I have created a multi-index based on 2 columns .
Those two columns wont appear properly, index_column "2" being duplicated from "1"
When displaying up to the 60th first rows of dataframe, it's fine, then it duplicates again the column 1 in the column 2.
Expected Output
Output of
pd.show_versions()
pandas: 0.19.1
nose: None
pip: 9.0.1
setuptools: 28.8.0
Cython: None
numpy: 1.11.2
scipy: 0.18.0
statsmodels: 0.6.1
xarray: None
IPython: 5.1.0
sphinx: None
patsy: 0.4.1
dateutil: 2.5.0
pytz: 2016.7
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.3
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.5.1
html5lib: None
httplib2: 0.9.2
apiclient: 1.5.1
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: