Closed
Description
If foo.csv contains
x,y
1,2
then you get the normal behavior:
>>> df = pd.read_csv('foo.csv', index_col=0)
>>> list(df.columns)
['y']
>>> df.index.name
'x'
but if you remove the data row "1,2" in the CSV the index name gets dropped:
>>> df = pd.read_csv('foo.csv', index_col=0)
>>> list(df.columns)
['y']
>>> df.index.name
None
This means round-tripping with to_csv/read_csv fails for empty dataframes.