Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Commit d14af78

Browse files
authored
Merge pull request #102 from g-kimbell/timestamp2
Bugfix timestamp interpolation
2 parents f0a2302 + 93efbf7 commit d14af78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

NewareNDA/NewareNDAx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ def _data_interpolation(df):
154154
df['Time'] = df['Time'].where(nan_mask2, time)
155155

156156
# Fill in missing Timestamps
157-
time_inc = df['Time'].diff().groupby(nan_mask.cumsum()).cumsum()
157+
time_inc = df['Time'].diff().groupby(nan_mask.shift().cumsum()).cumsum()
158158
timestamp = df['Timestamp'].ffill() + \
159-
pd.to_timedelta(time_inc.shift().fillna(0), unit='s')
159+
pd.to_timedelta(time_inc.fillna(0), unit='s')
160160
df['Timestamp'] = df['Timestamp'].where(nan_mask, timestamp)
161161

162162
# Integrate to get capacity and fill missing values

0 commit comments

Comments
 (0)