UvA Amsterdam


April 21-22 2022

9:30 am - 5:00 pm

Instructors: Tijs Bliek1, Marc Galland1, Sam Nooij2

Helpers: Kasper Abcouwer, Marcel Haas, Rodrigo Meneses, Stacy Shinneman, Berend Wijers





1: University of Amsterdam (UvA) , 2: Leiden University Medical Center (LUMC)

Introduction to data analysis and data visualization with Python

General Information


Python is a general purpose programming language that is useful for writing scripts to work effectively and reproducibly with data. This is an introduction to Python designed for participants with no programming experience. These lessons can be taught in one and a half days (~ 10 hours). They start with some basic information about Python syntax, the Jupyter notebook interface, and move through how to import CSV files, using the pandas package to work with data frames, how to calculate summary information from a data frame, and a brief introduction to plotting. The last lesson demonstrates how to work with databases directly from Python. This workshop is organised by Tijs Bliek and Marc Galland (members of the Amsterdam Science Park Study Group), Iris van der Knaap (Data Science Center, University of Amsterdam) and Sam Nooij (Leiden University Medical Center).

Who we are

This workshop is organized by the Data Science Center (part of the UvA of Amsterdam Library) and by members of the Amsterdam Science Park Study Group. These two communities aim to promote skill sharing and collaboration through the organisation of interactive workshops in scientific programming. They act as the main local hubs to set-up Software and Data Carpentry workshops (official workshops and Carpentry-style). All are welcome, regardless of scientific research area, affiliation or training level.

For more information on what we teach and why, see our websites: Science Park Study Group and Data Science Center.




Who: The course is primarily aimed, but not restricted to, graduate students, PhD students and other early career researchers from the University of Amsterdam. You don't need to have any previous knowledge of the tools that will be presented at the workshop.

Where:

Rooms:

Included: Coffee and tea will be included, Lunch is not included.

When: April 21-22 2022. Add to your Google Calendar.

Requirements: Participants must bring a laptop with a Mac, Linux, or Windows operating system (not a tablet, Chromebook, etc.) that they have administrative privileges on. They should have the specific software packages installed (listed below). We'll be available half an hour before the starting time to help out in case of problems with the installation.

Code of Conduct: Everyone who participates in Carpentries activities is required to conform to the Code of Conduct. This document also outlines how to report an incident if needed.

Accessibility: We are committed to making this workshop accessible to everybody. The workshop organizers have checked that:

Materials will be provided in advance of the workshop and large-print handouts are available if needed by notifying the organizers in advance. If we can help making learning easier for you (e.g. sign-language interpreters, lactation facilities) please get in touch (using contact details below) and we will attempt to provide them.

Contact: Please email bliek@uva.nl for more information.


Surveys

Please be sure to complete these surveys before and after the workshop.

Pre-workshop Survey

Post-workshop Survey


Schedule

Day 1 (Thursday 21 April)

Morning
(9:30-11:00)
Data Organization in Spreadsheets for Ecologists (Sam)
Coffee
Morning
(11:15-12:45)
Data Analysis and Visualization in Python.
Short Introduction to Programming in Python (Sam)
Lunch

Afternoon
(13:45-15:15)
Data Analysis and Visualization in Python.
Starting with Data (Tijs)
Tea
Afternoon
(15:30-17:00)
Data Analysis and Visualization in Python.
Data Types and Formats (Tijs)

Day 2 (Friday April 22)

Morning
(9:30-11:00)
Data Analysis and Visualization in Python.
Data Workflows and Automation (Marc)
Coffee
Morning
(11:15-12:45)
Data Analysis and Visualization in Python.
Making Plots With plotnine (Marc)
Lunch
Afternoon
(13:45-15:15)
Data Analysis and Visualization in Python.
Data Ingest and Visualization (Tijs)
Tea
Afternoon
(15:30-17:00)
Data Analysis and Visualization in Python.
Accessing SQLite Databases Using Python and Pandas (Marc)

We will use this collaborative document for chatting, taking notes, and sharing URLs and bits of code.


Syllabus

_

Setup


To participate in a this workshop, you will need access to the software described below. In addition, you will need an up-to-date web browser.

We maintain a list of common issues that occur during installation as a reference for instructors that may be useful on the Configuration Problems and Solutions wiki page.


Text Editor

When you're writing code, it's nice to have a text editor that is optimized for writing code, with features like automatic color-coding of key words. The default text editor on macOS and Linux is usually set to Vim, which is not famous for being intuitive. If you accidentally find yourself stuck in it, hit the Esc key, followed by :+Q+! (colon, lower-case 'q', exclamation mark), then hitting Return to return to the shell.

nano is a basic editor and the default that instructors use in the workshop. It is installed along with Git.

Others editors that you can use are Notepad++ or Sublime Text. Be aware that you must add its installation directory to your system path. Please ask your instructor to help you do this.

nano is a basic editor and the default that instructors use in the workshop. See the Git installation video tutorial for an example on how to open nano. It should be pre-installed.

Others editors that you can use are BBEdit or Sublime Text.

nano is a basic editor and the default that instructors use in the workshop. It should be pre-installed.

Others editors that you can use are Gedit, Kate or Sublime Text.


Python

Python is a popular language for research computing, and great for general-purpose programming as well. Installing all of its research packages individually can be a bit difficult, so we recommend Anaconda, an all-in-one installer.

Regardless of how you choose to install it, please make sure you install Python version 3.x (e.g., 3.6 is fine).

We will teach Python using the Jupyter notebook, a programming environment that runs in a web browser. For this to work you will need a reasonably up-to-date browser. The current versions of the Chrome, Safari and Firefox browsers are all supported (some older browsers, including Internet Explorer version 9 and below, are not).

  1. Open https://www.anaconda.com/download/#linux with your web browser.
  2. Download the Python 3 installer for Linux.
    (The installation requires using the shell. If you aren't comfortable doing the installation yourself stop here and request help at the workshop.)
  3. Open a terminal window.
  4. Type
    bash Anaconda3-
    and then press Tab. The name of the file you just downloaded should appear. If it does not, navigate to the folder where you downloaded the file, for example with:
    cd Downloads
    Then, try again.
  5. Press Return. You will follow the text-only prompts. To move through the text, press Spacebar. Type yes and press enter to approve the license. Press enter to approve the default location for the files. Type yes and press enter to prepend Anaconda to your PATH (this makes the Anaconda distribution the default Python).
  6. Close the terminal window.