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.
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