From 527d97b6f2d9387566c4325368642556d8211735 Mon Sep 17 00:00:00 2001 From: Marcel Zwiers Date: Mon, 4 Nov 2024 18:44:39 +0100 Subject: [PATCH] Bugfix --- bidscoin/bids.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bidscoin/bids.py b/bidscoin/bids.py index 041badc5..defbeeaf 100644 --- a/bidscoin/bids.py +++ b/bidscoin/bids.py @@ -115,9 +115,10 @@ def eventstable(self) -> pd.DataFrame: if self.time.get('start'): start = pd.Series([True] * len(df)) for column, value in self.time['start'].items(): - start &= self.logtable[column].astype(str) == str(value) + start &= (self.logtable[column].astype(str) == str(value)).values if start.any(): - df['onset'] = df['onset'] - df['onset'][start].iloc[0] # Take the time of the first occurrence as zero + LOGGER.bcdebug(f"Reseting clock offset of: {df['onset'][start.values].iloc[0]}") + df['onset'] = df['onset'] - df['onset'][start.values].iloc[0] # Take the time of the first occurrence as zero # Loop over the row groups to filter/edit the rows rows = pd.Series([len(self.rows) == 0] * len(df)).astype(bool) # Boolean series with True values if no row expressions were specified