ffajardo64 / python-workshop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction to Programming with Python

Workshop Information

  • Live session will take place on June 16, 2021.

Instructors

  • Milena Tsvetkova, Assistant Professor of Computational Social Science, Department of Methodology, LSE
  • Yuanmo He (GTA), PhD student in Social Research Methodology, Department of Methodology, LSE

Description

This workshop introduces students to the fundamentals of computer programming in Python. The workshop is intended for students who lack a formal background in the field. Topics include data types, control structures, functions, and an introduction to the principles of object-oriented programming. We will learn to design and write simple computer programs, using a practical example from computational social science.

Prerequisites

This is an introductory workshop and no prior experience with programming or Python is required.

Software

The workshop will use Jupyter Notebooks to edit and write code. Students have two options:

  1. Use Google Colab to work in the cloud via your web browser.

    1. You will need a Google account to use Colab so if you don't already have one, create it. Other than that, you do not need to install any specialized software.
    2. Open the Colab file in your browser by first clicking on the link and then on Open with Google Colaboratory on top of the page.
    3. Click on Copy to Drive to create your own copy, which you can edit and save.
  2. Alternatively, you can pre-install Python and Jupyter Notebooks locally on your personal computer and run them from there. Unfortunately, we will be unable to provide support for this option, so choose it only if you already have some experience with the software.

    1. Install Anaconda, which comes with both, as well as with the most common data science packages.
    2. Clone/download this repository on your computer.
    3. Run the Jupyter server and open the file python_intro.ipynb from the cloned repository.

Materials

All materials for the workshop are available at https://github.com/social-research/python-workshop.

Additional optional resources include:

Detailed outline

  1. Introduction to programming languages
  • Introduction to Jupyter Notebooks/Google Colab
  • Markup vs. programming languages
  1. Primitives in Python
  • Scalar data types, operators, expressions, and value assignment to variables
  • Non-scalar data types: str, list, tuple, set, and dict
  • Sequence operations and methods, aliasing vs. cloning
  1. Control flow in Python
  • Branching with if, elif, and else
  • Iteration with while and for
  • range() and list comprehensions
  1. Functions in Python
  • Function arguments and variable scope
  • Modules
  1. Data abstraction with objects and classes

About


Languages

Language:Jupyter Notebook 97.8%Language:Python 2.2%