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
- Part 1: Reading, viewing, and selecting data
- Part 2: Cleaning and operating on data
- 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
defaultdictandnamedtuple - 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