Skip to content

Commit

Permalink
prepare script
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Aug 24, 2023
1 parent c557d1f commit 2c94fc9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ds116/code/clean_events.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import pandas as pd
from pathlib import Path

root = Path(__file__).parent.parent

# list event.tsv

events_tsv = root.glob("sub-*/func/*task-*_events.tsv")

for event in events_tsv:
df = pd.read_csv(event, sep="\t")
# remove rows with "n/a" in the "onset" column
df = df[df["onset"] != "n/a"]
# save
df.to_csv(event, sep="\t", index=False)

0 comments on commit 2c94fc9

Please sign in to comment.