Giter VIP home page Giter VIP logo

python-workshop's Introduction

python-workshop

Python summer workshop

Prerequisites

Students are expected to go through the following chapters of the official Python documentation (https://docs.python.org/3.7/tutorial/). This should not take too long to read but can give students a quick view of the Python basics. Students do not necessarily need to set up a Python environment for this (we'll teach how to do that later). They can leverage online Python interpreters to paste-and-run the example code, such as LeetCode (https://leetcode.com/playground/new/empty).

  • Chapter 3
  • Chapter 4 (4.1 - 4.7.3)
  • Chapter 5 (5.1 - 5.6)
  • Chapter 9 (9.3 - 9.5)

Content

The course will give students an introduction to the programming language Python and some important libraries widely used in the financial industry. It will start with topics including Python environment setup, package management softwares, and core language features. It then will provide some in-depth tutorials to help students learn how to manipulate data with Numpy and Pandas, and visualize data with libraries such as Matplotlib. An real-world example will be used to illustrate how these tools can be used together in cleaning data. It will also cover advanced topics such as performance profiling/optimization, garbage collection/reference counting, JIT compiler, etc. After this course, we expect students to get comfortable with coding in Python for both general purpose and for exploratory data analysis. Students will be more prepared for later courses during the MFE program such as machine learning. We will be using Python 3.7 throughout this course although more recent versions have been released.

Session 1

  • Introduction to Python. History and current status. Comparison against other languages.
  • Virtualbox. Installation and Python environment setup (homework). Introduction to Jupyter notebook.
  • Install packages.
  • Built-in data types. Sequences, dictionaries and sets.
  • Functions. Arguments. Anonymous functions. Annotations.
  • Closure and decorator. Scope rules.

Session 2

  • Class. Static/class data and methods. Inheritance. Abstract base classes.
  • Context manager.
  • Iterators and generators.
  • Project structure. Using IDE.
  • Import mechanism.
  • Quality assurance with unit testing. PEP8. Pylint.

Session 3

  • Introduction to Numpy. What is vectorization, compared to the regular python loop. Vector-oriented programming
  • Ufunc
  • Numpy fancy index.
  • (Optional) Numpy dtypes.
  • (Optional) Numpy data serialization
  • Brief introduction to Scipy. scipy.linalg
  • Cython and numba and JIT compiler

Session 4

  • History and relationship with numpy
  • Introduction to Pandas.
  • Multilevel index, pivot table, groupby.  
  • Dates and Times in Python.
  • Data visualization with Matplotlib and others.
  • Data cleaning & exploratory data analysis with a real-world example.

Session 5

  • Introduction to standard libraries: itertools, functools, collections, etc. What kind you do with python’s standard library.
  • OS library. Scripting with Python. Launching external commands with subprocess. Working with filesystems.
  • Multithreading/multiprocessing. Python GIL
  • File I/O. Serialization (pickle, json, etc.) (possibly move to numpy session)

Session 6

  • Performance profiling and optimization (lprof in jupyter)
  • Debugging tools (pdb in jupyter)
  • Python object lifecycle, gc, reference counting (sys/inspect) and circular reference.
      • in arguments
      • in closure and context manager
      • in __del__
  • Concept of Concurrency & parallelism./Coroutines/ yield

Environment setup

Install VirtualBox

  • Students using Windows operating systems are strongly recommended to install VirtualBox in order to use a unix-like environment.
  • Students using MacOS can optionally use VirtualBox. But it's also fine to use the native OSX environment.
  • Instructions to set up Ubuntu with VirtualBox

Install Miniconda

Install Jupyter Notebook

Set up Github and learn git

Books

  • Think Python: The most basic of this list, Think Python provides a comprehensive Python reference.
  • Fluent Python: While Python’s simplicity lets you quickly start coding, this book teaches you how to write idiomatic Python code, while going into several deep topics of the language.
  • Effective Python: 59 Ways to Write Better Python: This relatively short book is a collection of 59 articles that, similarly to Fluent Python, focus on teaching you how to write truly Pythonic code.
  • Python Cookbook: As a cookbook, this will be a good reference on how to use Python to complete tasks you have done in another language.

python-workshop's People

Contributors

jvictorchen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.