First things first

Course description


Students in Cognitive-(Neuro)-science need to learn programming:

  1. to understand how computers work, because of the importance of the Computational Theory of Mind in Cognitive Science.

  2. to automate the boring stuff (e.g. repetitive work on files, web scrapping,)

  3. to do reproducible science: simulating models, designing experiments, running them, analysing data, …

The purpose of the PCBS course is to make students able to write clean code in order to solve the tasks that are typically encountered in cognitive or neurosciences (data manipulation and analysis, creation of stimuli, programming of real-time experiments, simulations…). The first half (6 weeks) of the course consists of lectures with hands-on exercises, then, during the last 6 weeks, students have to realize a project publicly available on

Learning outcomes

On successful completion of this course, students should be able to write readable, well- documented, Python programs, and use system such as git that promote reproducible science.

Pedagogy, class organization and homework

The first classes are lectures with hands-on exercices. The remaining classes, I and the teaching assistant are present for individual support to help the students accomplish their project. I also give weekly assignments to be done before the next lecture.


The projects will be graded on a 20 points scale. The main criterion is clarity (see Projects for more details).

Textbook and readings

All the materials are available on the course’s web site at

Course policies

Laptops: Students must bring there own laptop (preferably fully charged!) with the specified software preinstalled.

Participation. You are strongly encouraged to participate in lectures and on the slack discussion forum. The more advanced students are expected to help the beginners.


They should acquainted with basic programming concepts: instructions, variables, tests (if..then..else), loops (while and for).

Students are expected to know how to open a terminal and navigate in the file system and to know how to view and edit text files with a text editor such as Sublime Text.


Basic programming concepts

A fun way to get acquainted to learn the bases of programming is to play with Scratch. Check out my document Starting from Scratch

Programming skills

Resources to learn Python

Books relevant to Cognitive and Brain Sciences Programming

  • Programming Visual Illusions for Everyone by Marco Bertamini:

  • Neural Data Science: A Primer with MATLAB and Python by von Erik Lee Nylen and Pascal Wallisch

  • Matlab for Brain and Cognitive Scientists and Analyzing neural time series data by Mike X Cohen

  • Python in Neuroscience

  • Modeling Psychophysical Data in R by Kenneth Knoblauch & Laurence T. Maloney

Stimulus/Experiment generation modules

Data analyses, Statistics in Python


Resources to learn the command shell


  • Under Windows, after having installed Git, you have access to git bash, which provides a terminal with the bash shell and emulates many unix commands.

  • Under Windows 10, Microsoft has recently made available the “Windows Subsystem for Linux”, which provides a virtual Linux system running inside Windows. (See, and

  • Under MacOSX, when you open a terminal, you may be interacting withthe bash shell or the zsh shell (to know which, type echo $SHELL).

Resources to learn Git

To understand why you need to learn git, see Tools to do Reproducible Science