Filter tsvs using regex
@@ -344,9 +344,11 @@ def _load_tsv_variables(layout, type_, dataset=None, columns=None,
# Filter rows on all selectors
comm_cols = list(set(_data.columns) & set(selectors.keys()))
+ filter = [True] * _data.shape[0]
for col in comm_cols:
- vals = listify(selectors.get(col))
- _data = _data.query('%s in @vals' % col)
+ for val in listify(selectors.get(col)):
+ filter = filter & _data[col].str.match(val)
+ _data = _data[filter]
level = {'scans': 'session', 'sessions': 'subject',
'participants': 'dataset'}[type_]
