expyfun.io.read_tab#

expyfun.io.read_tab(fname, group_start='trial_id', group_end='trial_ok', return_params=False, allow_last_missing=False)[source]#

Read .tab file from expyfun output and segment into trials.

Parameters:
fnamestr

Input filename.

group_startstr

Key to use to start a trial/row.

group_endstr | None

Key to use to end a trial/row. If None, the next group_start will end the current group.

return_paramsbool

If True, return the JSON-parsed comment header.

allow_last_missingbool

If True, allow the last “trial_ok” data line to be missing. This should only be needed for old/legacy expyfun files.

Returns:
datalist of dict

The data, with a dict for each trial. Each value in the dict is a list of tuples (event, time) for each occurrence of that key.

paramsdict

The JSON-parsed comment header. Only returned if return_params=True.

See also

read_tab_raw

Examples using expyfun.io.read_tab#

Parsing demo

Parsing demo