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 VERSIONScommit: 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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4