Python tutorial

Table of Contents

Instructions for setting up and staying up-to-date with these tutorials can be found here.

Basics

Installation
Instructions for installing Python
Types
Some of the major types of objects
Control constructs
Controlling what code is executed
Command line input
Specifying values at the command line
File input and output
Reading and writing to files
Functions
Creating reusable operations
Importing
Accessing code from other files
Regular expressions
Matching operations
Mutability
Mutable versus immutable objects
List comprehensions
Conveniently filter and operate on lists
Exceptions
Raising and catching exceptions
Testing
Tools for making sure your code is correct

Packages

Python packages that we will cover:

Pandas
Data analysis library
Matplotlib
Plotting library

Other packages

Some interesting packages that we probably won't cover directly:

Biopython
Wide collection of tools for biology
bx-python
Genome analysis tools
collections
Some useful datatypes, especially defaultdict and namedtuple
csv
Reading and writing of delimited files
docopt
Convenient and fast way to write command line program
fileinput
A good solution for handling standard input and multiple input files
itertools
Handy functions for working with iterators
IPython notebook
IPython session within a text document
NumPy
Multi-dimensional arrays (Pandas is built on top of this)
statsmodels
Statistical library

A few other Python resources

Useful non-Python stuff

Bash cheat sheet
Important commands for working from the terminal

Released under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Created with Emacs 24.4.1 (Org mode 8.3beta)

Validate