From 815a33e40cf4c534666da592bbafed8db131554f Mon Sep 17 00:00:00 2001 From: Sam Vente Date: Thu, 27 Jul 2023 17:24:23 +0200 Subject: [PATCH] add index_col to df kwargs return --- hydromt/data_adapter/dataframe.py | 1 + 1 file changed, 1 insertion(+) 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)