From 79dcd4675d0a88b0dd9c02e9ba6a323ad6571c20 Mon Sep 17 00:00:00 2001 From: jdebacker Date: Thu, 8 Aug 2024 12:29:30 -0400 Subject: [PATCH] markdown table --- ogcore/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ogcore/utils.py b/ogcore/utils.py index 14ac43305..25896a551 100644 --- a/ogcore/utils.py +++ b/ogcore/utils.py @@ -433,8 +433,10 @@ def save_return_table(table_df, output_type, path, precision=2): table_df.to_csv(path_or_buf=path, index=False, na_rep="") elif output_type == "json": table_df.to_json(path_or_buf=path, double_precision=precision) - # elif output_type == "md": # TODO: figure out how to save md to disk - # table_df.to_markdown(path_or_buf=path, double_precision=precision) + elif output_type == "md": + table_df.to_markdown( + buf=path, index=False, floatfmt=".{}f".format(precision) + ) elif output_type == "excel": table_df.to_excel(excel_writer=path, index=False, na_rep="") else: