Writing metadata to csv files

95 views
Skip to first unread message

Philip Parker

unread,
Mar 30, 2023, 2:35:46 PM3/30/23
to Bonsai Users
Hello,

I am trying to write metadata to a CSV file where each row is an individual trial. The challenge is that some of the data are changing trial-to-trial and others are not. I am using Zip to combine all of the nodes with data that change on each trial (so that it just produces one output once each node has updated its value), then am using CombineLatest to combine those data with the other metadata that do not change (animal name, etc.). The problem is that I end up with nested data going into the CSV writer, and so some of the cells have parentheses in the data where I don't want them (see attached screenshots of workflow and CSV file. Is there some way to flatten the output of CombineLatest, or get rid of the nested parentheses, to avoid this? Or a more clever way to combine the data?

Also, I haven't been able to figure out how to include a header for each column. I can set IncludeHeader to 1 but where would I feed in the header names? Is there an property I can externalize to do this?

Thanks!
Phil


Workflow.png
Metadata.PNG

brunocruz

unread,
Mar 30, 2023, 4:15:53 PM3/30/23
to Bonsai Users
Hi!

We are making a push to move all discussions and Q&A to GitHub. As a result, I would invite you to copy your question there.

See you there,
Bruno

Chi-Yu Lee

unread,
Jun 27, 2023, 5:08:43 PM6/27/23
to Bonsai Users
Hi, in case you still want to write meta data in, have a look at the workflow I post on the Github Q&A discussion.
Reply all
Reply to author
Forward
0 new messages