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 [103] Can't resist writing about Python - (2004-10-29)
[955] Python collections - mutable and imutable - (2006-11-29)
[1144] Python dictionary for quick look ups - (2007-04-12)
[1145] Using a list of keys and a list of values to make a dictionary in Python - zip - (2007-04-13)
[2368] Python - fresh examples of all the fundamentals - (2009-08-20)
[2915] Looking up a value by key - associative arrays / Hashes / Dictionaries - (2010-08-11)
[2986] Python dictionaries - reaching to new uses - (2010-10-05)
[2994] Python - some common questions answered in code examples - (2010-10-10)
[3464] Passing optional and named parameters to python methods - (2011-10-04)
[3488] Python sets and frozensets - what are they? - (2011-10-20)
[3554] Learning more about our web site - and learning how to learn about yours - (2011-12-17)
[3662] Finding all the unique lines in a file, using Python or Perl - (2012-03-20)
[3934] Multiple identical keys in a Python dict - yes, you can! - (2012-11-24)
[4027] Collections in Python - list tuple dict and string. - (2013-03-04)
[4029] Exception, Lambda, Generator, Slice, Dict - examples in one Python program - (2013-03-04)
[4409] Setting up and using a dict in Python - simple first example - (2015-01-30)
[4469] Sorting in Python 3 - and how it differs from Python 2 sorting - (2015-04-20)
[4661] Unique word locator - Python dict example - (2016-03-06)
[4668] Sorting a dict in Python - (2016-04-01)
Some other Articles
Well House Consultants - Open Source Programming Courses for 2012Python or Lua - which should I use / learn?Melksham Christmas Lights - Town, Shops and Private HousesAeryn at 1Football league tables - under old and new point system. Python program.Changes to morning routinesMelksham 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!