Skip to content

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

Closed
@santegoeds

Description

@santegoeds
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions