ffrprep.group.merge_covariates

ffrprep.group.merge_covariates(metrics, covariate_paths, return_sources=False)[source]

Left-join subject-level covariate TSVs onto a metrics table.

Each TSV needs a participant_id column (sub-<label>, as in a BIDS participants.tsv or phenotype/*.tsv). Columns already present in metrics are not overwritten. Missing files are skipped with a warning.

Returns:

metrics with the covariate columns appended. With return_sources=True a (table, sources) tuple, where sources maps each appended column to the file it came from.

Return type:

pandas.DataFrame