From db050046dd9eff33fc185708ffbb8f7d24fe0d9b Mon Sep 17 00:00:00 2001 From: Richard Hitier Date: Fri, 27 Oct 2023 16:01:59 +0200 Subject: [PATCH] Order cols even if one is missing --- web/run.py | 1 + 1 file changed, 1 insertion(+), 0 deletions(-) diff --git a/web/run.py b/web/run.py index 9fe4325..ea7fcc7 100755 --- a/web/run.py +++ b/web/run.py @@ -946,6 +946,7 @@ def generate_csv_contents_spz(target_slug, input_slug, started_at, stopped_at): final_df['vtot'] = final_df.apply(lambda x: sqrt(x.vtan * x.vtan + x.vrad * x.vrad), axis=1) cols_ordered = ['vrad', 'vtan', 'vtot', 'btan', 'brad', 'temp', 'pdyn', 'dens', 'atse', 'xhee', 'yhee'] + cols_ordered = [_c for _c in cols_ordered if _c in final_df.columns] final_df = final_df[cols_ordered] final_df.index.name = 'time' return final_df.to_csv(date_format='%Y-%m-%dT%H:%M:%S+00:00', float_format="%.5f", -- libgit2 0.21.2