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

Closed
santegoeds opened this Issue Jun 29, 2015 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

santegoeds commented Jun 29, 2015

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

Contributor

jreback commented Jun 29, 2015

might be related to #10413

pull-requests to fix welcome

jreback added this to the Next Major Release milestone Jun 29, 2015

Contributor

santegoeds commented Jun 29, 2015

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

Contributor

santegoeds commented Jun 29, 2015

See #10469

@jreback jreback modified the milestone: 0.17.0, Next Major Release Jun 30, 2015

jreback closed this in #10469 Jul 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment