Skip to content

About

Foundations of Psychological Data Science I

Topics

Resources

Stars

17 stars

Watchers

1 watching

Forks

Repository files navigation

Foundations of Psychological Data Science I

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.

YOURLIFE_1

What you will be able to do

  • 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.

Course map

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]
Loading

Getting started

Option 1: in your browser, nothing to install

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

Option 2: on your own computer (recommended for the course)

  1. Install Python with Anaconda and install Git. Tutorial 1 walks you through Anaconda and Jupyter.
  2. 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
  3. Open the notebooks:
    jupyter lab
    The tutorials use numpy, pandas, matplotlib and seaborn, all included in Anaconda.

Working through a tutorial

  1. 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 NameError usually means an earlier cell has not been run.
  2. Read, then change things. Edit a number, re-run the cell and see what happens.
  3. Do the exercises before looking anything up; the mistakes are where the learning happens.

How the files are named

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.


The tutorials

Getting set up: Jupyter, GitHub and the terminal

# tutorial run online
1 Anaconda and Jupyter notebooks Open in Colab
2 GitHub: overview and making an account
3 Making a repository; writing Markdown
4 The terminal and the file system
4 Basic shell commands
4 File system exercises
5 Git and GitHub from the terminal
5 Cloning a repository to your computer
5 Basic Git exercise: add, commit, push, pull
5 Homework: terminal, Git and GitHub

Python basics

# tutorial run online
6 Reading and writing data files Open in Colab
7 Variables and operators Open in Colab
8 Data types and containers: lists, tuples, dictionaries Open in Colab
9 Control flow I: loops Open in Colab
10 Control flow II: if-logic Open in Colab

NumPy, plotting and functions

# tutorial run online
11 NumPy: numerical operations Open in Colab
11 NumPy: loops and logical operators with arrays Open in Colab
12 Plotting with matplotlib Open in Colab
12 Review Open in Colab
13 NumPy: understanding and creating data Open in Colab
14 Reusing code with functions Open in Colab

Working with data: pandas, wrangling, time series, seaborn

# tutorial run online
15 Pandas I: fundamental objects Open in Colab
16 Data wrangling: making data useful for analysis Open in Colab
17 Automating data wrangling Open in Colab
18 Pandas: indexing and advanced data manipulation Open in Colab
19 Writing your own Python modules Open in Colab
19 Review: loops and indexing with data frames Open in Colab
20 Dates and time series I Open in Colab
21 Seaborn overview Open in Colab
22 Dates and time series II Open in Colab

Projects

Students apply what they learn in a data visualisation project; an example project shows what one can look like.


Course information

Course description

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.

Requirements

  • 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.

Learning activities

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.


Also in this repository

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

Found a mistake?

Open an issue, or fix it yourself with a pull request, as practised in Tutorials 3 and 5.

License

The course material is released under the MIT License.

About

Foundations of Psychological Data Science I

Topics

Resources

Stars

17 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages