Skip to content

Commit

Permalink
Enforce unique
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Nov 20, 2024
1 parent 52f3244 commit 0761b35
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/parl_motion_detector/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,13 @@ def move_to_package(data_dir: Path = data_dir):
df = pd.concat(dfs)
# sort by first column
df = df.sort_values(by=df.columns[0])

# remove duplicate rows
df = df.drop_duplicates()

# check there are no duplicated values in the first column

if df[df.columns[0]].duplicated().sum() != 0:
raise ValueError("Duplicated values in the first column")

df.to_parquet(package_dir / file_ending)

0 comments on commit 0761b35

Please sign in to comment.