diff --git a/utils/df_utils.py b/utils/df_utils.py index c5d2c45..d256b04 100644 --- a/utils/df_utils.py +++ b/utils/df_utils.py @@ -19,9 +19,15 @@ class DateFrameHolder: from io import BytesIO -def to_excel_binary(df): +def to_excel_binary(df, **kwargs): with BytesIO() as out: - df.to_excel(out) + df.to_excel(out, **kwargs) + res = out.getvalue() + return res + +def to_hdf_binary(df, key="df", **kwargs): + with BytesIO() as out: + df.to_hdf(out, key, **kwargs) res = out.getvalue() return res