From f194905ecdbaef78a1dd506284e4575ed9a4dc8d Mon Sep 17 00:00:00 2001 From: Sam Vente Date: Mon, 31 Jul 2023 14:37:16 +0000 Subject: [PATCH] Update hydromt/data_adapter/dataframe.py Co-authored-by: DirkEilander --- hydromt/data_adapter/dataframe.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hydromt/data_adapter/dataframe.py b/hydromt/data_adapter/dataframe.py index 368e96380..f4f6db5de 100644 --- a/hydromt/data_adapter/dataframe.py +++ b/hydromt/data_adapter/dataframe.py @@ -166,12 +166,13 @@ def to_file( logger.warning(str(err)) return None, None, None + read_kwargs = dict() if driver is None or driver == "csv": # always write as CSV driver = "csv" fn_out = join(data_root, f"{data_name}.csv") obj.to_csv(fn_out, **kwargs) - kwargs["index_col"] = obj.index.name + read_kwargs["index_col"] = obj.index.name elif driver == "parquet": fn_out = join(data_root, f"{data_name}.parquet") obj.to_parquet(fn_out, **kwargs)