-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
IO CSVread_csv, to_csvread_csv, to_csvOutput-Formatting__repr__ of pandas objects, to_string__repr__ of pandas objects, to_string
Milestone
Description
This seems strange to me, but I don't often use a MultiIndex so I might be missing something obvious.
>>> pd.__version__
'0.13.1-420-g6899ed6'
>>> df2 = pd.DataFrame([1], columns=pd.MultiIndex.from_arrays([[1],[2]]))
>>> df2
1
2
0 1
[1 rows x 1 columns]
>>> df2.columns
MultiIndex(levels=[[1], [2]],
labels=[[0], [0]])
>>> print df2.to_csv()
,1
,2
,
0,1
Is there supposed to be that empty line at the end of the header? Compare
>>> print df2.to_csv(header=False)
0,1
Metadata
Metadata
Assignees
Labels
IO CSVread_csv, to_csvread_csv, to_csvOutput-Formatting__repr__ of pandas objects, to_string__repr__ of pandas objects, to_string