README.md 6.18 KB
Newer Older
1
## Introduction to Python Programming
2
###### Materials for a course providing an introduction to programming in Python.
3

4
__Click the button below to launch the course materials in an interactive environment, thanks to the [Binder](http://mybinder.org) service from [The Freeman Lab](http://thefreemanlab.com).__ (Current build of Binder materials: 22-Mar-2016)  
5

Toby Hodges's avatar
Toby Hodges committed
6 7
[![Binder](http://mybinder.org/badge.svg)](http://mybinder.org/repo/tobyhodges/ITPP)

8 9
The course materials are divided into sections. You can use the links below to view each section in your browser. There is an overlap between the material in section 3 and in sections 4 & 5, which we recommend that you choose between. 

10 11 12 13 14
1. [Getting Started](http://nbviewer.jupyter.org/github/tobyhodges/ITPP/blob/master/1_GettingStarted.ipynb) - an introduction to the basics of the language
2. [Beginning Programming](http://nbviewer.jupyter.org/github/tobyhodges/ITPP/blob/master/2_BeginningProgramming.ipynb) - exploring some of the central concepts and operations of programming
3. [Input and Output](http://nbviewer.jupyter.org/github/tobyhodges/ITPP/blob/master/3_InputAndOutputMPL.ipynb) - reading in, handling, and plotting data with the `matplotlib` library
4. [Nested Data Structures](http://nbviewer.jupyter.org/github/tobyhodges/ITPP/blob/master/4_NestedDataStructures.ipynb) - an introduction to creating and working with more complex data structures
5. [Plotting Data With Bokeh](http://nbviewer.jupyter.org/github/tobyhodges/ITPP/blob/master/5_PlottingDataWithBokeh.ipynb) - creating interactive plots with the `bokeh` library
15

16
##### The Language
Toby Hodges's avatar
Toby Hodges committed
17 18 19
Python is a high-level programming language, which is highly versatile, relatively accessible, and extremely well-supported. If you've never programmed before, Python is a great language to start with. A couple of the big reasons for this are: by the standards of programming languages, it is easy for humans to read; and, instead of spending a lot of time worrying about defining rigid types and arranging things in multiple files, it is quick to get started with actually _doing things_ with Python. 

This course focuses on handling tabular data and creating plots, but, after learning some of the language, you could use Python for a huge range of other tasks, such as: automating repetitive tasks; generating web content; processing images; creating cross-platform GUI applications; or writing programs to quickly perform complex analyses. These are just a few examples of the possibilities. 
20

21
##### The Course
22
This course provides an introduction to programming with the Python language. The course material is suitable for complete beginners, with no previous programming experience or knowledge required or assumed.  
23

24 25
The course was first written for a target audience of life scientists, and this is reflected in the simplistic example dataset used for the plotting exercises, but the material itself is designed to be accessible also for people with no scientific background, and the skills taught can be applied to a _much_ wider range of disciplines. Some knowledge of foundational mathematics is assumed.

26 27 28 29 30 31
The materials are split into broad sections, which we call worksheets, containing exercises for you to try and most of the information that you will need to complete them. The material covered is far from exhaustive. Instead, we try to provide enough information and tasks to get you started and we hope to get you quite quickly to a level where you are then capable to continuing to use Python for your own projects.

These materials are free to use. If you would prefer to attend a course in person, these are run in the Department of Biology at the [University of York](http://www.york.ac.uk/biology/technology-facility/bioinformatics/bi-tf-courses/), UK. For a similar introduction to programming (as well as other essential computing skills), check out [Software Carpentry](http://software-carpentry.org).

You can always get more information on any topic/object type/function etc. by looking at the Python help pages - type `help(object)` in the Python shell to get help on _object_ - or the 'cheat sheet', or by searching online. The online Python documentation (for [version 2.7](https://docs.python.org/2/) or [version 3](https://docs.python.org/3/)), people's previous questions on [StackOverflow](http://stackoverflow.com), and a lot of the module homepages are very good places to start.  

32 33 34 35 36 37 38
If you work through the materials, you will learn:
* the basic concepts and building blocks of programming in Python
* how to quickly automate repetitive tasks and calculations
* the best ways of handling different types of data
* about working with the extensive catalogue of subject-specific modules available for Python
* how to read data from a file, process, and summarise it
* how to visualise data using Python’s powerful plotting libraries
39

40 41
We recommend using the [Anaconda distribution](https://store.continuum.io/cshop/anaconda/) of Python. It's free and comes with a large number of additional modules included ready for importing into your scripts, IPython shell and notebook interfaces, a powerful Python text editor (Spyder), and a good package manager, _conda_, for updating and installing packages.   

42
As well as the main notebooks, we provide walkthroughs of the equivalent plotting exercises in Sections 3 and 5, for your reference.  
43 44
[Exercise 3.6](http://nbviewer.jupyter.org/github/tobyhodges/ITPP/blob/master/Exercise3_6WalkthroughMPL.ipynb)  
[Exercise 5.6](http://nbviewer.jupyter.org/github/tobyhodges/ITPP/blob/master/Exercise5_6WalkthroughBokeh.ipynb)  
45
If you are taking the course, or working through the materials on your own, try to find your own solution to these exercises, and then use this ipynb if you get stuck, or want to compare your results to ours.
46

47 48 49 50 51
All materials written by:
* [Peter D Ashton](https://www.york.ac.uk/biology/research/bioinformatics-biosystems/peter-d-ashton/) (Department of Biology, University of York, UK)
* [Holger Dinkel](https://git.embl.de/u/dinkel) (Gibson Team, European Molecular Biology Laboratory)
* [Toby Hodges](https://www.github.com/tobyhodges) (Zeller Team, European Molecular Biology Laboratory)
* [Karin Sasaki](https://git.embl.de/u/valencia) (Centre for Biological Modelling, European Molecular Biology Laboratory)