Software Carpentry: Plotting and Programming with Python

ICR Chelsea

Mon Nov 11 2024 and Mon Nov 18, 2024

13:00 pm - 16:30 pm

Instructors: Rachel Alcraft

Helpers: tbc

General Information

The Carpentries project comprises the Software Carpentry, Data Carpentry, and Library Carpentry communities of Instructors, Trainers, Maintainers, helpers, and supporters who share a mission to teach foundational computational and data science skills to researchers.

Want to learn more and stay engaged with The Carpentries? Carpentries Clippings is The Carpentries' biweekly newsletter, where we share community news, community job postings, and more. Sign up to receive future editions and read our full archive: https://carpentries.org/newsletter/

Software Carpentry aims to help researchers get their work done in less time and with less pain by teaching them basic research computing skills. This hands-on workshop will cover basic concepts and tools, including program design, version control, data management, and task automation. Participants will be encouraged to help one another and to apply what they have learned to their own research problems.

For more information on what we teach and why, please see our paper "Best Practices for Scientific Computing".

Who: The course is aimed at graduate students and other researchers. You don't need to have any previous knowledge of the tools that will be presented at the workshop.

Where: Chelsea: Lecture theatre. Get directions with OpenStreetMap or Google Maps.

When: Mon Nov 11 2024 and Mon Nov 18, 2024; 13:00 pm - 16:30 pm 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 a few specific software packages installed (listed below).

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

We are dedicated to providing a positive and accessible learning environment for all. We do not require participants to provide documentation of disabilities or disclose any unnecessary personal information. However, we do want to help create an inclusive, accessible experience for all participants. We encourage you to share any information that would be helpful to make your Carpentries experience accessible. To request an accommodation for this workshop, please fill out the accommodation request form. If you have questions or need assistance with the accommodation form please email us.

Glosario is a multilingual glossary for computing and data science terms. The glossary helps learners attend workshops and use our lessons to make sense of computational and programming jargon written in English by offering it in their native language. Translating data science terms also provides a teaching tool for Carpentries Instructors to reduce barriers for their learners.

Contact: Please email rachel.alcraft@icr.ac.uk for more information.

Roles: To learn more about the roles at the workshop (who will be doing what), refer to our Workshop FAQ.


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.


Surveys

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

Pre-workshop Survey

Post-workshop Survey


Schedule

Plotting and Programming with Python Index Page

Session 1: Mon 11th Nov afternoon

13:00-13:15 Setup Instructions + Pre-workshop survey Setup, ensure everything works, fill out survey
13:15-13:30 1. Running and QuittingHow can I run Python programs?
13:30-13:50 2. Variables and AssignmentHow can I store data in programs?
13:50-14:10 3. Data Types and Type ConversionWhat kinds of data do programs store?
How can I convert one type to another?
14:10-14:35 4. Built-in Functions and HelpHow can I use built-in functions?
How can I find out what theydo?
What kind of errors can occur in programs?
14:35-14:50 5. Morning Coffee
14:50-15:10 6. LibrariesHow can I use software that other people have written?
How can I find out what that software does?
15:10-15:30 7. Reading Tabular Data into DataFramesHow can I read tabular data?
15:30-16:00 8. Pandas DataFramesHow can I do statistical analysis of tabular data?
16:00-16:30 9. PlottingHow can I plot my data?
How can I save my plot for publishing?

Session 2: Mon 18th Nov afternoon

13:00-13:15Setup and make sure all still works
13:15-13:3511. ListsHow can I store multiple values?
13:35-14:0012. For LoopsHow can I make a program do many things?
14:00-14:2513. ConditionalsHow can programs do different things for different data?
14:25-14:4014. Looping Over Data SetsHow can I process many data sets with a single command?
14:40-14:5515. Afternoon Coffee
14:55-15:2016. Writing FunctionsHow can I create my own functions?
15:20-15:5017. Variable ScopeHow do function calls actually work?
How can I determine where errors occurred?
15:50-16:1018. Programming StyleHow can I make my programs more readable?
How do most programmers format their code?
How can programs check their own operation?
16:10-16:3019. Wrap-UpWhat have we learned?
What else is out there and where do I find it?
16:3020. Post-workshop SurveyHow did the class go?

Setup

To participate in a Software Carpentry workshop, you will need access to software and data as 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.

Data

Please check the "Getting the Data section of" page of the lesson homepage for instructions to follow to obtain the data you will need to follow the lesson.

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 (Jupyter Notebook will be installed by Anaconda). 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/success with your web browser.
  2. Download the Anaconda for Windows installer with Python 3. (If you are not sure which version to choose, you probably want the 64-bit Graphical Installer Anaconda3-...-Windows-x86_64.exe)
  3. Install Python 3 by running the Anaconda Installer, using all of the defaults for installation except make sure to check Add Anaconda to my PATH environment variable.

Video Tutorial

  1. Open https://www.anaconda.com/download/success with your web browser.
  2. Download the Anaconda Installer with Python 3 for macOS (you can either use the Graphical or the Command Line Installer).
  3. Install Python 3 by running the Anaconda Installer using all of the defaults for installation.

Video Tutorial

  1. Open https://www.anaconda.com/download/success with your web browser.
  2. Download the Anaconda Installer with Python 3 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 and navigate to the directory where the executable is downloaded (e.g., `cd ~/Downloads`).
  4. Type
    bash Anaconda3-
    and then press Tab to autocomplete the full file name. The name of file you just downloaded should appear.
  5. Press Enter (or Return depending on your keyboard). 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 (or Return) to approve the default location for the files. Type yes and press Enter (or Return) to prepend Anaconda to your PATH (this makes the Anaconda distribution the default Python).
  6. Close the terminal window.