Programming

Programming related posts

In this category you will find posts that are related to programming and should be interesting for psychologists, cognitive scientists, and neuroscientists. Well, almost every researcher would probably find some of the information useful at some time!

Every research psychologist, cognitive scientist, and neuroscientist, should know how to program.. Knowing how to program and write scripts will make many of a researchers everyday tasks much easier. For instance, instead of going through line after line of raw data you can write a Python script that runs through each cell in each column. Furthermore, you get the possibility to use more advanced, and cutting edge, statistical techniques by using R statistical programming environment.

Another example might be to create experiments using PsychoPy (either by coding using Python or using the drag-and-drop interface) and the cheap and open-source Arduino microcontroller. Also, coding is fun and relaxing!

reverse scores

Reverse Scoring in Python with Pandas

In this post, we will learn how to reverse scores in Python. Reversing questionnaire scores is easy; this post is concise. Why you Need to Reverse Code We sometimes want to reverse the scoring when working with questionnaires that use a Likert scale (e.g., strongly disagree, disagree, neutral, agree, strongly agree).  For instance, in a …

Reverse Scoring in Python with Pandas Read More »

Python script for trial randomization

In this post you will find a Python script for randomizing conditions with constraints (i.e., never 2 consecutive trials of X). This script will in a later post be implemented in a cross-modal oddball task created in Psychopy. I recently started to use Psychopy to build experiments. To build my experiments (mainly oddball tasks) I …

Python script for trial randomization Read More »

Scroll to Top