Skip to content

Commit 7397d9d

Browse files
committed
fix(processing): check NA rows only for x, y, z columns when calculating time deltas
This is mainly for the recently added new Matrix device parser which includes columns that are sparse.
1 parent cf280b3 commit 7397d9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/actipy/processing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def quality_control(data, sample_rate):
7575
info['EndTime'] = data.index[-1].strftime(time_format)
7676
info['NumTicks'] = len(data)
7777
tol = pd.Timedelta('1s')
78-
tdiff = data.dropna().index.to_series().diff() # Note: Index.diff() was only added in pandas 2.1
78+
tdiff = data.dropna(subset=['x', 'y', 'z']).index.to_series().diff() # Note: Index.diff() was only added in pandas 2.1
7979
total_time = tdiff[tdiff < tol].sum().total_seconds()
8080
num_interrupts = (tdiff > tol).sum()
8181
del tdiff # we're done with this

0 commit comments

Comments
 (0)