-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
to_csv() with a single level row MultiIndex does not produce the desired output #19589
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
Labels
API Design
IO CSV
read_csv, to_csv
Output-Formatting
__repr__ of pandas objects, to_string
Regression
Functionality that used to work in a prior pandas version
Milestone
Comments
cc @gfyoung |
@joe1gi : Thanks for the report! I agree: the outputs should match. PR to patch is welcome! |
4 tasks
jreback
pushed a commit
that referenced
this issue
Nov 1, 2018
Display the level by itself instead of as a tuple (i.e. "squash" the MultiIndex into a single level) Closes gh-19589.
tm9k1
pushed a commit
to tm9k1/pandas
that referenced
this issue
Nov 19, 2018
Display the level by itself instead of as a tuple (i.e. "squash" the MultiIndex into a single level) Closes pandas-devgh-19589.
Pingviinituutti
pushed a commit
to Pingviinituutti/pandas
that referenced
this issue
Feb 28, 2019
Display the level by itself instead of as a tuple (i.e. "squash" the MultiIndex into a single level) Closes pandas-devgh-19589.
Pingviinituutti
pushed a commit
to Pingviinituutti/pandas
that referenced
this issue
Feb 28, 2019
Display the level by itself instead of as a tuple (i.e. "squash" the MultiIndex into a single level) Closes pandas-devgh-19589.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
API Design
IO CSV
read_csv, to_csv
Output-Formatting
__repr__ of pandas objects, to_string
Regression
Functionality that used to work in a prior pandas version
Code Sample, a copy-pastable example if possible
Problem description
The output for
index.nlevels==1
should be the same as forindex.nlevels==2
, with one column less. That matches the output from other index types and was the output produced by pandas up to 0.20.3.Expected Output
Output of
pd.show_versions()
pandas: 0.22.0
pytest: 3.2.1
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.25.2
numpy: 1.11.3
scipy: 0.19.0
pyarrow: None
xarray: None
IPython: 5.1.0
sphinx: 1.5.1
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: 1.2.0
tables: 3.4.2
numexpr: 2.6.1
feather: None
matplotlib: 2.0.0
openpyxl: 2.4.1
xlrd: 1.0.0
xlwt: 1.2.0
xlsxwriter: 0.9.6
lxml: 4.1.1
bs4: 4.5.3
html5lib: None
sqlalchemy: 1.1.5
pymysql: None
psycopg2: None
jinja2: 2.9.4
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: