From a440fe13fd27657bb8f8d50f77e66c1d80f975b1 Mon Sep 17 00:00:00 2001 From: Loann Peurey Date: Tue, 11 Feb 2025 13:51:19 +0100 Subject: [PATCH] keep index and sort through compute-durations cli --- ChildProject/cmdline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChildProject/cmdline.py b/ChildProject/cmdline.py index 3ef31b89..8e544fe0 100755 --- a/ChildProject/cmdline.py +++ b/ChildProject/cmdline.py @@ -726,12 +726,12 @@ def compute_durations(args): durations = project.compute_recordings_duration(profile=args.profile).dropna() - recordings = project.recordings.merge( + recordings = project.recordings.reset_index().merge( durations[durations["recording_filename"] != "NA"], how="left", left_on="recording_filename", right_on="recording_filename", - ) + ).set_index('index') recordings["duration"].fillna(0, inplace=True) recordings["duration"] = recordings["duration"].astype("Int64")