psychopy.org | Reference | Downloads | Github

Save data to new output

Dear users,

Apologies if this has been posted elsewhere. I’ve created an experiment that exports data (accuracy and RT based on keyboard presses, etc) to a .csv by default. I would like to export a few specific variables to my output file. I’m aware that I can add new variables to the output with thisEXP.addData(), but I find that the default output contains a lot of junk that I don’t need. Is there a way to create a completely new output file, which just contains the variables I want?

Thanks!

Yes, that’s just a general Python question about using the CSV writer: https://docs.python.org/2/library/csv.html

But it’s far better to have a comprehensive data output. You never know when you’ll need that extra bit of information that you don’t think is important right now. Most data analysis pipelines make it very easy to ignore unneeded variables. If that seems troublesome, it might be worth re-evaluating your analysis approach.

e.g. in R/tidyverse:

dat = read.csv('some data file.csv) %>%
    select(subject_id, rt, answer)