From ed9f9f4c5aadf0bb5858484ea9522f92519d8f7d Mon Sep 17 00:00:00 2001 From: Blallo Date: Thu, 25 Aug 2022 23:05:07 +0200 Subject: [PATCH] Fix serialization --- latecomers/serializer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/latecomers/serializer.py b/latecomers/serializer.py index ac0372f..a96cbf7 100644 --- a/latecomers/serializer.py +++ b/latecomers/serializer.py @@ -29,6 +29,8 @@ def to_excel(data: T.List[Details]) -> bytes: df = pd.DataFrame(data, columns=mapping) df["status"] = df["status"].map(lambda x: x.value) df.set_index("th_arrival", inplace=True) + df.rename(columns=mapping, inplace=True) + df = df.rename_axis(index=mapping["th_arrival"]) with NamedTemporaryFile() as tmp: df.to_excel(tmp)