Skip to content

Allow @ queries for metadata #5400

@jona-sassenhagen

Description

@jona-sassenhagen

Metadata-based querying of Epochs is very powerful. For example, these work:

import mne
path_kword = mne.datasets.kiloword.data_path() + '/kword_metadata-epo.fif'
kword = mne.read_epochs(path_kword)
kword["NumberOfLetters == 4 & ConsonantVowelProportion < .5"], kword["WORD == 'area'"]

But what doesn't work is pulling a variable from the current scope with @:

word = 'area'
kword.metadata.query("WORD == @word")

This works, in Pandas. But this errors:

kword["WORD == @word"]

Would be cool to have!

@choldgraf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions