-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
DeprecateFunctionality to remove in pandasFunctionality to remove in pandasIO CSVread_csv, to_csvread_csv, to_csvNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action
Description
Code Sample
df.to_csv(file_path)
df = pd.read_csv(file_path)
Problem description
Currently, the default CSV writing behaviour is to write the index column. The default reading behaviour, however, is to assume there is no index column in the file. This is not intuitive when writing and reading files.
The expected behaviour is that a file which is written without any index option it should be able to be read without any index option. However, the default writing and reading behaviour results in an unnamed column.
One fix is to change the default index_col for read_csv, another option is to change the default index boolean for to_csv. The former is probably preferable as it preserves information.
rfiischer
Metadata
Metadata
Assignees
Labels
DeprecateFunctionality to remove in pandasFunctionality to remove in pandasIO CSVread_csv, to_csvread_csv, to_csvNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action