Skip to content

Commit

Permalink
fix: use .total_seconds() instead of .seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
chanshing committed Apr 26, 2024
1 parent 0530c90 commit 8daf507
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/stepcount/stepcount.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def _mean(x):
def summarize_steps(Y, steptol=3, adjust_estimates=False):
""" Summarize step count data """

dt = pd.Timedelta(infer_freq(Y.index)).seconds
dt = infer_freq(Y.index).total_seconds()
W = Y.mask(~Y.isna(), Y >= steptol).astype('float')

if adjust_estimates:
Expand Down Expand Up @@ -395,7 +395,7 @@ def na_to_median(x):
.transform(na_to_median)
)

dt = pd.Timedelta(infer_freq(Y.index)).seconds
dt = infer_freq(Y.index).total_seconds()
steptol_in_minutes = steptol * 60 / dt # rescale steptol to steps/min
minutely = Y.resample('T').sum().rename('Steps') # steps/min

Expand Down

0 comments on commit 8daf507

Please sign in to comment.