Created
July 24, 2017 21:59
-
-
Save adelavega/7847a7595414a8c357d440de1c1cf6da to your computer and use it in GitHub Desktop.
Fix stim_files in studyorrest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bids.grabbids import BIDSLayout | |
import pandas as pd | |
import os.path as op | |
layout = BIDSLayout('../') | |
event_files = layout.get(task='objectcategories', type='events', return_type='file') | |
for f in event_files: | |
events = pd.read_csv(f, delimiter='\t') | |
events['stim_file'] = events.stim_file.str.replace('stimuli/', '') | |
events.to_csv(f, sep='\t') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment