Skip to content

Commit

Permalink
Merge pull request #102 from g-kimbell/timestamp2
Browse files Browse the repository at this point in the history
Bugfix timestamp interpolation
  • Loading branch information
d-cogswell authored Feb 6, 2025
2 parents f0a2302 + 93efbf7 commit d14af78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions NewareNDA/NewareNDAx.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ def _data_interpolation(df):
df['Time'] = df['Time'].where(nan_mask2, time)

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

# Integrate to get capacity and fill missing values
Expand Down

0 comments on commit d14af78

Please sign in to comment.