Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
Python and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Lua, etc
 
Football league tables - under old and new point system. Python program.

In 1981, football scoring for the top divisions of the league changed from 2 points for a win to 3 points for a win in the 1981 season [ref]. This was done to encourage positive play, and discourage boring defensive games played for a goalless draw.

How much difference would it make if the old scoring system was still in place today? What would the league table look like today if this season was being scored on 2 points for a win and 1 for a draw?

When I was training in Python last week, I wrote a script to take the current season's results to date, and re-rank them. And it's quite surprising how few changes resulted. Only in mid-table does it make a difference. Here's the table with comparative points:

  Manchester City 38 26
  Manchester United 36 25
  Chelsea 31 21
  Tottenham Hotspur 31 21
  Arsenal 29 20
  Liverpool 26 19
  Newcastle United 26 19
  Stoke City 21 15
  Aston Villa 19 15
  Norwich City 19 14
  Swansea City 17 13
  Everton 16 11
  Queens Park Rangers 16 12
  Fulham 15 12
  West Bromwich Albion 15 11
  Sunderland 14 11
  Wolverhampton Wanderers 14 10
  Wigan Athletic 12 9
  Blackburn Rovers 10 8
  Bolton Wanderers 9 6


The first column of values is current points; the second is "2 per win" points. Yes - it's all very much lower numbers in the second column - but then this is a ranking system, so it's the order not the magnitude that matters. Only from Everton (16 or 11 points) to Sunderland (14 or 11 points) has there been any change. Here's the oldstyle ranking table:

  Manchester City 26
  Manchester United 25
  Tottenham Hotspur 21
  Chelsea 21
  Arsenal 20
  Liverpool 19
  Newcastle United 19
  Aston Villa 15
  Stoke City 15
  Norwich City 14
  Swansea City 13
  Fulham 12
  Queens Park Rangers 12
  Sunderland 11
  West Bromwich Albion 11
  Everton 11
  Wolverhampton Wanderers 10
  Wigan Athletic 9
  Blackburn Rovers 8
  Bolton Wanderers 6


Whether we're analysing soccer league tables, web site arrivals, or streams of DNA bases, Python is a powerful and quick tool. The program I wrote that produces the above alternative table may be found [here], and the data can be seen [here]. There's a downloadable copy of the data [here]. Please don't cut and paste from the other display, as you'll mix up tabs and spaces. You can also grab a (current) set of tables from football.co.uk.

The Python source code for an exercise like this turned out to be less that 2000 characters ... and most of those are comments which are purely to help the reader / anyone who's going to change the program later see what it does. While teaching Python on the < href=http://www.wellho.net/course/python.html>Python Progamming Course, we wrote this example and then tried other scoring systems too - such as 2 points for an away draw, 1 for a home draw, and 3 points for a win. And we saw some very interesting changes.

If you want to learn Python, or another programming language, we've plenty of courses next year. Our web site lists future public courses, and if we're not training a public course we're available for private (single company) courses. We can run private courses at your office or private courses at our training centre, tailored to suit your exact needs.
(written 2011-12-18, updated 2011-12-24)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
Y107 - Python - Dictionaries
  [4668] Sorting a dict in Python - (2016-04-01)
  [4661] Unique word locator - Python dict example - (2016-03-06)
  [4469] Sorting in Python 3 - and how it differs from Python 2 sorting - (2015-04-20)
  [4409] Setting up and using a dict in Python - simple first example - (2015-01-30)
  [4029] Exception, Lambda, Generator, Slice, Dict - examples in one Python program - (2013-03-04)
  [4027] Collections in Python - list tuple dict and string. - (2013-03-04)
  [3934] Multiple identical keys in a Python dict - yes, you can! - (2012-11-24)
  [3662] Finding all the unique lines in a file, using Python or Perl - (2012-03-20)
  [3554] Learning more about our web site - and learning how to learn about yours - (2011-12-17)
  [3488] Python sets and frozensets - what are they? - (2011-10-20)
  [3464] Passing optional and named parameters to python methods - (2011-10-04)
  [2994] Python - some common questions answered in code examples - (2010-10-10)
  [2986] Python dictionaries - reaching to new uses - (2010-10-05)
  [2915] Looking up a value by key - associative arrays / Hashes / Dictionaries - (2010-08-11)
  [2368] Python - fresh examples of all the fundamentals - (2009-08-20)
  [1145] Using a list of keys and a list of values to make a dictionary in Python - zip - (2007-04-13)
  [1144] Python dictionary for quick look ups - (2007-04-12)
  [955] Python collections - mutable and imutable - (2006-11-29)
  [103] Can't resist writing about Python - (2004-10-29)


Back to
Learning more about our web site - and learning how to learn about yours
Previous and next
or
Horse's mouth home
Forward to
Aeryn at 1
Some other Articles
Well House Consultants - Open Source Programming Courses for 2012
Python or Lua - which should I use / learn?
Melksham Christmas Lights - Town, Shops and Private Houses
Aeryn at 1
Football league tables - under old and new point system. Python program.
Changes to morning routines
Melksham Training Centre and Hotel internet speed - how does it compare?
Some terms used in programming (Biased towards Python)
Provide a useable train service, and people will use it!
4759 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2019: 404 The Spa • Melksham, Wiltshire • United Kingdom • SN12 6QL
PH: 01225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/3555_Foo ... gram-.html • PAGE BUILT: Sat May 27 16:49:10 2017 • BUILD SYSTEM: WomanWithCat