Exceptions are sometimes "sold" as a way of trapping errors - but they're more than that - they're an excellent way of trapping conditions where there isn't a valid result.
"How many people live in this house" you may ask of a function / method call, and the answer may come back as "2" or "5" ... o ....

Some very interesting graphs from our server log data, courtesy of Python, numpy and matplotlib. Truly, a picture paints a thousand words. The data in the first and last diagrams is raw - showing exact number of hits per hour; in other diagrams I have used proximity smoothing which makes the trends ....

When you copy a list in Perl, you're duplicating the data and you end up with two distinct copies ... but when you copy a list in Python, you're copying the reference so that you end up with two names for the same variable - almost like an alias.
So in Perl - with two different copies - you end up ....

How many boats will the link canal ... the river through the town ... and the ongoing Wilts and Berks canal bring to Melksham? Not as many as you might think - I've seen it written somewhere that out of every 100 people visiting the river in such a scheme, only 4 will arrive by boat - and as there ....

Some tips and new examples from last week ... Python in Plymouth!
• How do I put comments in a Python regular expression to make it more readable: [source]
• How do I use a python dictionary as a table of counters - in our example, counting the number of people in our team who have each ....

If you want a program to run quickly through a data set (that's the sort of thing you'll be doing in heavy scientific work), you'll want the data loaded into successive memory locations - but that means that you have to know how much space to allocate before you set the data up. Otherwise, you'll f ....

Matplotlib provides Python with a graph drawing and data representation tool that is extremely flexible - in fact so flexible that it's hard for the newcomer to know where to start.
The following examples are very straightforward, but useful, graphs showing real data sets (from the second example o ....

If you're using big data sets in Python, you're probably using the numpy module - providing you with fast data handlers at C speed of running, and Python coding speed. But how do you load that data in? Numpy also provides a number of data handlers, data setup routines, and also a save and restore ....

In Python, all the operators are really methods - in other words, you write
c = d + e
and you're really writing
c = d . __add__ ( e )
So this means that it's possible to use the language to handle data of any sort, including data types that aren't supported at standard. It ....

I've been staying in Plymouth this week - and some evenings I've had a brief opportunity to walk around and see some of the sights of the city. Here are some of the more "oddball" pictures ... not quote the standard tourist views of the Hoe and the Barbican.
This has been a tough ....