diff --git a/hydromt/data_adapter/dataframe.py b/hydromt/data_adapter/dataframe.py index ab1b8a8d7..67e5691cc 100644 --- a/hydromt/data_adapter/dataframe.py +++ b/hydromt/data_adapter/dataframe.py @@ -167,6 +167,7 @@ def to_file( driver = "csv" fn_out = join(data_root, f"{data_name}.csv") obj.to_csv(fn_out, **kwargs) + kwargs["index_col"] = obj.index.name elif driver == "excel": fn_out = join(data_root, f"{data_name}.xlsx") obj.to_excel(fn_out, **kwargs)