Skip to content
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: read_csv: invalid index from header-only input file with multiindex. #10467

Closed
santegoeds opened this issue Jun 29, 2015 · 3 comments · Fixed by #10469
Closed

BUG: read_csv: invalid index from header-only input file with multiindex. #10467

santegoeds opened this issue Jun 29, 2015 · 3 comments · Fixed by #10469
Labels
Milestone

Comments

@santegoeds
Copy link
Contributor

import pandas as pd
import cStringIO as stringio

df = pd.read_csv(stringio.StringIO("x,y,z"), index_col=["x", "y"])
print df.columns
print df.index.names

Output:

$ python x.py
Index([u'y'], dtype='object')
[u'x', u'y']

Expected column name is "z".

INSTALLED VERSIONS

commit: 01995b2
python: 2.7.3.final.0
python-bits: 64
OS: Linux
OS-release: 2.6.18-400.1.1.el5
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_GB

pandas: 0.16.2-58-g01995b2
nose: 1.3.0
Cython: 0.22
numpy: 1.9.2
scipy: 0.9.0
statsmodels: None
IPython: 3.2.0
sphinx: None
patsy: None
dateutil: 2.4.2
pytz: 2015.2
bottleneck: 0.6.0
tables: 3.2.0
numexpr: 2.4.3
matplotlib: 1.3.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.2.1
html5lib: 0.90
httplib2: $Rev$
apiclient: None
sqlalchemy: 0.9.4
pymysql: None
psycopg2: None

@jreback
Copy link
Contributor

jreback commented Jun 29, 2015

might be related to #10413

pull-requests to fix welcome

@jreback jreback added Bug IO CSV read_csv, to_csv MultiIndex labels Jun 29, 2015
@jreback jreback added this to the Next Major Release milestone Jun 29, 2015
@santegoeds
Copy link
Contributor Author

Hi @jreback - I know where the problem lies and will create a PR for this.

@santegoeds
Copy link
Contributor Author

See #10469

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants