Skip to content

Commit

Permalink
πŸ› fix: update cgm pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
megasanjay committed Sep 30, 2024
1 parent 24b1423 commit 3d45dd0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cgm/cgm.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,11 @@ def convert(
# df = pd.read_excel(input_path, engine='openpyxl')
patient = df["Patient Info"][2]

# drop rows from spreadsheet that we do not need in data series
df.drop(index=df.index[:5], inplace=True)
# Dynamically detect and remove metadata rows
# Find the first row where "Timestamp (YYYY-MM-DDThh:mm:ss)" is not empty
first_data_index = df[df["Timestamp (YYYY-MM-DDThh:mm:ss)"].notna()].index[0]
# Keep only the rows from the first data index onward
df = df.loc[first_data_index:].reset_index(drop=True)

# drop columns that have no data
df.drop(
Expand Down

0 comments on commit 3d45dd0

Please sign in to comment.