[WIP] Python for Statistical Analysis

Launch Binder  View on Github  Download Zip  Download TarGz  last updated

A Tufts University Data Lab Workshop
Written by Uku-Kaspar Uustalu

datalab.tufts.edu  @TuftsDataLab

Slides: tufts.box.com/v/python-stats
Live offerings: go.tufts.edu/workshops
Contact: datalab-support@elist.tufts.edu


Table of Contents


Workshop Overview

This hands-on interactive workshop demonstrates implementing various statistical analysis workflows in Python. The workshop notebook is a work in progress and intends to cover the following:

The notebook is designed to be run in a pre-configured cloud-computing environment via Binder and does not require the installation of any software. It is also possible to run the workshop notebook using a local Anaconda or Mambaforge installation. Instructions on how to install Anaconda or Mambaforge are available here: go.tufts.edu/installingPython


Running the Workshop Notebook using a Virtual JupyterLab Instance (Recommended)

Launch Binder

  1. Click on the Launch Binder button above.
  2. A Binder instance will launch in a new tab with the message Starting Repository.
  3. Wait patiently and do not close the Binder tab. After a few minutes, a JupyterLab instance will launch.
  4. If the workshop notebook does not automatically open, double-click on python-stats.ipynb in the file browser on the left.

Running the Workshop Notebook using a Local Anaconda or Mambaforge Installation

Download Zip  Download TarGz

  1. Launch a Conda-Enabled Terminal or Command Prompt.
    • Windows (Anaconda): Start > Anaconda3 > Anaconda Prompt
    • Windows (Mambaforge): Start > Mambaforge > Mambaforge Prompt
    • macOS: Applications > Utilities > Terminal
  2. Run the following commands by typing or pasting the command into the console and then pressing Enter or Return.
    • Download and extract the workshop materials:
      curl -Lo - https://github.com/tuftsdatalab/python-stats/archive/workshop.tar.gz | tar -xzf -
    • Navigate into the extracted directory: cd python-stats-workshop
    • Create a new environment for the workshop.
      • Anaconda: conda env create -f environment.yml
      • Mambaforge: mamba env create -f environment.yml
    • Activate the workshop environment: conda activate python-stats
    • Open the workshop notebook in JupyterLab: jupyter lab python-stats.ipynb
  3. JupyterLab will launch in a web browser. (A new tab will be generated if a browser is already open.)
  4. If the workshop notebook does not automatically open, double-click on python-stats.ipynb in the file browser on the left.
  5. Do not close the console! Closing the console will also terminate JupyterLab. Leave the console running in the background.