Are you running a lab based study, which you wrote in the coder interface?
Could you show us the definition of ouputFile?
If I had to guess, I would say that you opened a file in binary write mode with a line like this:
outputFile = open('myfile.csv','wb')
Does the error disappear if you leave out the b?
outputFile = open('myfile.csv','w')
Is there a particular reason for using the write() method instead of methods provided by the csv or the pandas library? I find that they make writing data to a file at the end of an experiment much more convenient.