Coder Social home page Coder Social logo

tobyhodges / itpp Goto Github PK

View Code? Open in Web Editor NEW
12.0 5.0 8.0 4.85 MB

Introduction to Python Programming

License: Other

Jupyter Notebook 97.87% Python 2.13%
course-materials python-programming python-language language-python programming-language beginner-friendly jupyter-notebooks binder exercises

itpp's Introduction

Introduction to Python Programming

A programming course suitable for beginners

Click the button below to launch the course materials in an interactive environment, thanks to the Binder service from The Freeman Lab. (Current build of Binder materials: 17-Jan-2018)

Binder

Welcome to Introduction to Python Programming. The course materials are divided into sections. You can use the links below to view each section in your browser.

  1. Getting Started - an introduction to the basics of the language
  2. Beginning Programming - exploring some of the central concepts and operations of programming
  3. Nested Data Structures - an introduction to creating and working with more complex data structures
  4. Plotting Data - creating interactive plots with the matplotlib & bokeh libraries
The Language

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.

The Course

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.

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.

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, UK. For a similar introduction to programming (as well as other essential computing skills), check out Software Carpentry.

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 or version 3), people's previous questions on StackOverflow, and a lot of the module homepages are very good places to start.

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

We recommend using the Anaconda distribution 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.

As well as the main notebooks, we provide walkthroughs of the plotting exercises in Section4, for your reference.
Exercise 4.6
Exercise 4.7
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.

All materials written by:

  • Peter D Ashton (Department of Biology, University of York, UK)
  • Holger Dinkel (formerly of Gibson Team, European Molecular Biology Laboratory)
  • Toby Hodges (Zeller Team, European Molecular Biology Laboratory)
  • Karin Sasaki (EICAT, European Molecular Biology Laboratory)

itpp's People

Contributors

tobyhodges avatar unode avatar zencore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

itpp's Issues

Python 2 -> 3 changes

We have some legacy references that are somewhat confusing for newcomers. Listing them here for later edit.

  • The cheat sheet claims that myDict.keys() returns a list of keys when in fact it returns a view in py3
  • There are references to [range()] vs list(range()) which produce different results under Python 3 and were found to be confusing.
  • https://pyformat.info as a good resource for .format() and f-strings.
  • Relying too much on index based access can have performance impacts - mention for a, b in zip(as, bs) as alternative. Explain zip() returns generator/iterator.
  • Avoid use of .keys() in for loops.
  • Update bokeh imports - from bokeh.io import gridplot is now from bokeh.layouts import gridplot
  • Introduce with and clarify that closing files is important.
  • There are some cases of \ at the end of the line to visual line breaking. This was confusing in the context of \.format().
  • The text mentions pip install but since we are using anaconda we should probably install things with conda ...
  • A few people ran into the situation where they accidentally emptied one of the provided files by opening it in 'w' mode. Can we maybe make this more robust to avoid accidentally deleting the file or making a copy to simplify the process of recovering from this mistake.

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.