mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 19:20:55 +00:00
Update packages/jspsych/src/modules/data/DataCollection.ts
Co-authored-by: bjoluc <mail@bjoluc.de>
This commit is contained in:
parent
cafc6a1f65
commit
9180ab9671
@ -135,14 +135,11 @@ export class DataCollection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
filterColumns(columns: Array<string>) {
|
filterColumns(columns: Array<string>) {
|
||||||
const filtered_data = [];
|
return new DataCollection(
|
||||||
for (const trial of this.trials) {
|
this.trials.map((trial) =>
|
||||||
const filtered_columns = Object.fromEntries(
|
Object.fromEntries(columns.filter((key) => key in trial).map((key) => [key, trial[key]]))
|
||||||
columns.filter((key) => key in trial).map((key) => [key, trial[key]])
|
)
|
||||||
);
|
);
|
||||||
filtered_data.push(filtered_columns);
|
|
||||||
}
|
|
||||||
return new DataCollection(filtered_data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
select(column) {
|
select(column) {
|
||||||
|
Loading…
Reference in New Issue
Block a user