The first course in data science for psychology and brain-science students (FDS-I). No previous coding experience is required. You learn to work with data in Python, step by step: Jupyter notebooks, GitHub and the terminal, Python basics, NumPy, plotting, and data wrangling with pandas.
Instructors: Lawrence Cormack cormack@utexas.edu | Franco Pestilli pestilli@utexas.edu
Part of a two-course series: this course → Foundations of Psychological Data Science II, which continues with simulation, regression, machine learning, databases, AI and neural networks.
- work like a data scientist: Jupyter notebooks, the terminal, Git and GitHub;
- write Python: variables, data types, loops, conditions, functions and modules;
- read and write data files;
- compute with NumPy arrays and simulate data;
- make figures with matplotlib and seaborn;
- load, clean, reshape and combine data with pandas, including dates and time series.
flowchart LR
A[Getting set up<br/>Jupyter, GitHub,<br/>terminal, Git<br/>Tutorials 1-5] --> B[Python basics<br/>reading data, variables,<br/>containers, loops, if-logic<br/>Tutorials 6-10]
B --> C[NumPy, plotting<br/>and functions<br/>Tutorials 11-14]
C --> D[Working with data<br/>pandas, wrangling,<br/>time series, seaborn<br/>Tutorials 15-22]
D --> E[FDS II<br/>simulation, regression,<br/>machine learning, AI,<br/>neural networks]
Click an Open in Colab badge in the tables below: the notebook opens in Google Colab and runs on Google's computers (a Google account is needed). Tutorials that read files from tutorials/datasets/ need a copy of the repository; in the first cell of the Colab notebook run:
!git clone https://github.com/psychdatascience/FDS-CourseOne.git
%cd FDS-CourseOne/tutorials- Install Python with Anaconda and install Git. Tutorial 1 walks you through Anaconda and Jupyter.
- Get the material, by cloning (Tutorial 5 shows how) or with Code → Download ZIP on GitHub:
git clone https://github.com/psychdatascience/FDS-CourseOne.git cd FDS-CourseOne - Open the notebooks:
The tutorials use
jupyter lab
numpy,pandas,matplotlibandseaborn, all included in Anaconda.
- Run it from the top (Run → Run All Cells, or one cell at a time with Shift-Enter): later cells use variables defined in earlier ones. A
NameErrorusually means an earlier cell has not been run. - Read, then change things. Edit a number, re-run the cell and see what happens.
- Do the exercises before looking anything up; the mistakes are where the learning happens.
All tutorials are in the tutorials/ folder, together with the datasets/ and assets/ (images) they use. Each tutorial is named tuNNN_Topic: the number gives the order of the course, the name its subject. Some numbers have several parts (for example the three terminal tutorials, all number 4). Files ending in .ipynb are Jupyter notebooks; files ending in .md are written tutorials done in the browser, the terminal or on GitHub.
| # | tutorial | run online |
|---|---|---|
| 6 | Reading and writing data files | |
| 7 | Variables and operators | |
| 8 | Data types and containers: lists, tuples, dictionaries | |
| 9 | Control flow I: loops | |
| 10 | Control flow II: if-logic |
| # | tutorial | run online |
|---|---|---|
| 11 | NumPy: numerical operations | |
| 11 | NumPy: loops and logical operators with arrays | |
| 12 | Plotting with matplotlib | |
| 12 | Review | |
| 13 | NumPy: understanding and creating data | |
| 14 | Reusing code with functions |
Students apply what they learn in a data visualisation project; an example project shows what one can look like.
This course lays the foundation for data science education targeting psychological and brain science students. No previous coding experience is required. The students will be introduced to basic concepts and tools for data analysis. The focus is on hands-on practice and enjoyable learning. The course will use python as the programming language, and Jupyter Notebooks as the development environment (our “home base”) for the examples, tutorials, and assignments. We use Jupyterlab Notebooks because they are both the industry standard and a nice way to load, visualize, and analyze data as well as describe our findings in one environment. We will also learn GitHub to document changes and backup our work and, eventually, for use as a collaboration tool.
The course is flipped, meaning that the students will be required to follow short pre-recorded video lectures and or written tutorials, and then we’ll spend the class time actually writing code and playing with data. Hands-on data analysis, final projects and associated presentations will be mandatory for the completion of the course. The final outcome for the class is that each student will have a GitHub repository with all of their work (Jupyter notebooks, data, etc.), including a final project that will be presented to the class.
Specific topics to be covered include: GitHub, Jupyter Notebooks, Python Programming, Data Visualization, Simulation and Data analysis, Data Modelling, Ordinary Least-square regression and Generalized Linear Models.
Course Prerequisites There are no prerequisites for the course.
-
BYOL - Bring Your Own Laptop to class for hands on participation. The College or Department might have a loaner service for the duration of the course.
-
Software installed on your laptop:
-
Python installation via Anaconda: https://www.anaconda.com/products/individual.
-
The git code management tool: https://git-scm.com/.
-
Read Understand and Respect the class code of conduct (see below under POLICIES)
-
Remember this class is about learning and having fun. We are here to provide you with the opportunity to learn something helpful for your future.
This class will comprise various learning activities. A. In-class coding exercises to walk through the coding and data analysis tools.
B. Papers, book chapters, videos, and notes will be required as reading in preparation for some classes.
C. Project-driven data analysis students will complete a series of reports to practice the coding and data concepts covered by the tutorials.
| file or folder | contents |
|---|---|
TutorialsList.md |
the list of tutorials |
cheatsheets/ |
Git and GitHub reference sheets and handouts |
projects/ |
the data visualisation project |
examples/ |
example notebooks: a plotting-function exercise, an exercise for Tutorial 21, an example visualisation project, and a short history of Monte Carlo simulation |
course-notes/ |
the outline of the first class |
REFERENCES.md |
sources of the examples, data and code used in the course |
unused/ |
earlier versions of tutorials, kept for reference |
Open an issue, or fix it yourself with a pull request, as practised in Tutorials 3 and 5.
The course material is released under the MIT License.
