Skip to content

Commit be35808

Browse files
authored
Merge pull request #399 from Remi-Gau/ds116_cleanup
[MAINT] ds116 cleanup
2 parents e857597 + 101afd6 commit be35808

File tree

103 files changed

+18
-249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+18
-249
lines changed

ds116/code/clean_events.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import pandas as pd
2+
from pathlib import Path
3+
from rich import print
4+
5+
root = Path(__file__).parent.parent
6+
7+
# list event.tsv
8+
9+
events_tsv = root.glob("sub-*/func/*task-*_events.tsv")
10+
11+
for event in events_tsv:
12+
# replace "n/a" with "NaN"
13+
df = pd.read_csv(event, sep="\t", na_values="n/a")
14+
print(df)
15+
# # remove rows with NaN in the "onset" column
16+
df = df.dropna(subset=["onset"])
17+
# save replacing NaN with "n/a" and with 3 decimal places
18+
df.to_csv(event, sep="\t", na_rep="n/a", float_format="%.3f", index=False)

ds116/sub-01/func/sub-01_task-auditoryoddballwithbuttonresponsetotargetstimuli_run-01_events.tsv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,3 @@ onset duration trial_type Response Stimulus response_time
149149
316.180 0.200 auditory standard stimulus presentation 0.000 standard n/a
150150
318.430 0.200 auditory standard stimulus presentation 0.000 standard n/a
151151
321.260 0.200 auditory standard stimulus presentation 0.000 standard n/a
152-
n/a n/a n/a 6.728 0 standard
153-
n/a n/a n/a 8.747 0 standard

ds116/sub-01/func/sub-01_task-auditoryoddballwithbuttonresponsetotargetstimuli_run-02_events.tsv

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,3 @@ onset duration trial_type Response Stimulus response_time
149149
311.700 0.200 auditory standard stimulus presentation 0.000 standard n/a
150150
314.148 0.200 auditory standard stimulus presentation 0.000 standard n/a
151151
316.780 0.200 auditory standard stimulus presentation 0.000 standard n/a
152-
n/a n/a n/a 5.492 0 standard
153-
n/a n/a n/a 7.907 0 standard
154-
n/a n/a n/a 9.942 0 standard

ds116/sub-01/func/sub-01_task-auditoryoddballwithbuttonresponsetotargetstimuli_run-03_events.tsv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,3 @@ onset duration trial_type Response Stimulus response_time
149149
317.789 0.200 auditory standard stimulus presentation 0.000 standard n/a
150150
319.824 0.200 auditory oddball stimulus presentation 1.000 target n/a
151151
319.824 0.354 behavioral response time following auditory oddball stimulus onset 1.000 target n/a
152-
n/a n/a n/a 5.857 0 standard
153-
n/a n/a n/a 8.074 0 standard

ds116/sub-01/func/sub-01_task-visualoddballwithbuttonresponsetotargetstimuli_run-01_events.tsv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,3 @@ onset duration trial_type Response Stimulus response_time
149149
305.524 0.410 behavioral response time following visual oddball stimulus onset 1.000 target n/a
150150
308.120 0.200 visual standard stimulus presentation 0.000 standard n/a
151151
310.521 0.200 visual standard stimulus presentation 0.000 standard n/a
152-
n/a n/a n/a 4.643 0 standard
153-
n/a n/a n/a 7.457 0 standard

ds116/sub-01/func/sub-01_task-visualoddballwithbuttonresponsetotargetstimuli_run-02_events.tsv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,3 @@ onset duration trial_type Response Stimulus response_time
146146
315.391 0.200 visual standard stimulus presentation 0.000 standard n/a
147147
317.593 0.200 visual standard stimulus presentation 0.000 standard n/a
148148
319.594 0.200 visual standard stimulus presentation 0.000 standard n/a
149-
n/a n/a n/a 6.371 0 standard
150-
n/a n/a n/a 8.589 0 standard

ds116/sub-01/func/sub-01_task-visualoddballwithbuttonresponsetotargetstimuli_run-03_events.tsv

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,3 @@ onset duration trial_type Response Stimulus response_time
148148
307.638 0.200 visual oddball stimulus presentation 1.000 target n/a
149149
307.638 0.426 behavioral response time following visual oddball stimulus onset 1.000 target n/a
150150
309.641 0.200 visual standard stimulus presentation 0.000 standard n/a
151-
n/a n/a n/a 5.154 0 standard
152-
n/a n/a n/a 7.966 0 standard
153-
n/a n/a n/a 9.985 0 standard

ds116/sub-02/func/sub-02_task-auditoryoddballwithbuttonresponsetotargetstimuli_run-01_events.tsv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,3 @@ onset duration trial_type Response Stimulus response_time
144144
316.764 0.200 auditory oddball stimulus presentation 1.000 target n/a
145145
316.764 0.538 behavioral response time following auditory oddball stimulus onset 1.000 target n/a
146146
318.817 0.200 auditory standard stimulus presentation 0.000 standard n/a
147-
n/a n/a n/a 5.941 1 standard
148-
n/a n/a n/a 8.356 1 standard

ds116/sub-02/func/sub-02_task-auditoryoddballwithbuttonresponsetotargetstimuli_run-02_events.tsv

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,3 @@ onset duration trial_type Response Stimulus response_time
147147
315.160 0.200 auditory standard stimulus presentation 0.000 standard n/a
148148
318.205 0.200 auditory standard stimulus presentation 0.000 standard n/a
149149
320.654 0.200 auditory standard stimulus presentation 0.000 standard n/a
150-
n/a n/a n/a 5.015 0 standard
151-
n/a n/a n/a 7.232 0 standard
152-
n/a n/a n/a 9.268 0 standard

ds116/sub-02/func/sub-02_task-auditoryoddballwithbuttonresponsetotargetstimuli_run-03_events.tsv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,3 @@ onset duration trial_type Response Stimulus response_time
149149
317.538 0.200 auditory standard stimulus presentation 0.000 standard n/a
150150
319.788 0.200 auditory standard stimulus presentation 0.000 standard n/a
151151
322.832 0.200 auditory standard stimulus presentation 0.000 standard n/a
152-
n/a n/a n/a 4.677 0 standard
153-
n/a n/a n/a 7.490 0 standard

0 commit comments

Comments
 (0)