Tuesday 20 December 2016

Which Really Useful Boxes stack?

Which Really Useful Boxes stack together?

"Really Useful Boxes" are great. They come in lots of sizes and are used everywhere. The sales literature gives examples of what you can store in them.

But which sizes stack exactly on top of each other?

The list below shows the boxes that stack, grouped by those with the most common size.
(Scroll down for the Python script that was used to group the data).


Length Width (mm)                     Box Name
----------------------------------------------
    395   255     4 litre Really Useful Box (ream of A4)
    395   255     9 litre Really Useful Box (ream of A4)
    395   255     9 litre XL Really Useful Box (7" small)
    395   255    14 litre open front Really Useful Box (shoes)
    395   255    19 litre Really Useful Box (A4 paper)
    395   255    19 litre XL Really Useful Box (LP small)
    395   255    25 litre Really Useful Box (12" x 12")
----------------------------------------------
    710   440    20 litre Really Useful Box (board games)
    710   440    33 litre Really Useful Box 
    710   440    50 litre Really Useful Box
    710   440    64 litre Really Useful Box
    710   440    64 litre open front Really Useful Box
    710   440    84 litre Really Useful Box
----------------------------------------------
    340   200     2.5 litre Really Useful Box
    340   200     5 litre Really Useful Box
    340   200     5 litre XL Really Useful Box
    340   200     8 litre open front Really Useful Box
----------------------------------------------
    480   390    18 litre Really Useful Box
    480   390    18 litre XL Really Useful Box (7" medium)
    480   390    35 litre Really Useful Box
    480   390    35 litre XL Really Useful Box (LP medium)
----------------------------------------------
    600   400    24.5 litre Really Useful Box
    600   400    48 litre Really Useful Box
    600   400    48 litre XL Really Useful Box
----------------------------------------------
    465   270     6 litre Really Useful Box
    465   270    12 litre Really Useful Box
    465   270    24 litre Really Useful Box
----------------------------------------------

The following boxes only have one 'partner in size':

Length Width (mm)                     Box Name
----------------------------------------------
    090   065    0.07 litre Really Useful Box
    090   065    0.14 litre Really Useful Box
----------------------------------------------
    120   085    0.2 litre Really Useful Box
    120   085    0.3 litre Really Useful Box
----------------------------------------------
    155   100    0.35 litre Really Useful Box
    155   100    0.7 litre Really Useful Box
----------------------------------------------
    195   135    0.75 litre Really Useful Box
    195   135    1.6 litre Really Useful Box
----------------------------------------------
    220   100    0.55 litre Really Useful Box
    220   100    0.9 litre Really Useful Box
----------------------------------------------
    245   180    1.75 litre Really Useful Box
    245   180    3 litre Really Useful Box
----------------------------------------------
    355   100    0.8 litre Really Useful Box
    355   100    1.5 litre Really Useful Box
----------------------------------------------
    450   350   21 litre Really Useful Box
    450   350   21 litre XL Really Useful Box
----------------------------------------------
    456   356   11 litre Really Useful Box
    455   356   11 litre XL Really Useful Box
----------------------------------------------
    810   620   70 litre Really Useful Box
    810   620  145 litre Really Useful Box
----------------------------------------------

The following boxes don't stack exactly with any other sized box.

    180   135    1.7 litre folding Really Useful Box
    240   130    2.1 litre Really Useful Box
    430   180    6.5 litre Really Useful Box
    400   350    7 litre Really Useful Box
    520   340   10 litre Really Useful Box
    820   255   22 litre Really Useful Box
    470   342   32 litre folding Really Useful Box
    485   390   35 litre folding Really Useful Box
    520   440   42 litre Really Useful Box
    390   570   45 litre folding Really Useful Box
   1201   270   77 litre Really Useful Box


The Python Script

This section is intended for those interested in how the data was prepared.

The data comes from the table here, and was copied-and-pasted into a text file. The top line was edited to make a tab-separated header row.

The python script was written as an exercise in using Pandas Dataframes. The goal was to read the file, parse, sort, and filter, then group the boxes on external length and width. Although this could have been done manually on this dataset (59 rows), the manual approach does not scale to larger datasets.

Here is the script.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
 Parse the sizes of ReallyUsefulBoxes and group them by external dimension.
'''

import pandas as pd

filename = 'ReallyUsefulBoxesRaw.txt'
list_data = pd.read_csv(filename, sep='\t')
# force a rename of the columns
list_data.columns = ['BoxName','Extl','Intl','Wt']

# ---extract external dimension data into 3 new DataFrame columns:
extList = list_data['Extl'].str.split(' x ')
list_data['Length'] = [row[0] for row in extList]
list_data['Width'] = [row[1] for row in extList]
list_data['Height'] = [row[2] for row in extList]

# Just use the columns of interest
trimmed_data = list_data[['Length','Width','BoxName']]
grouped_data = trimmed_data.groupby(['Length','Width'])
#print grouped_data

# Print out each group: these are the boxes that have the same width and
# height and therefore stack together.
for name, group in grouped_data:
    print '\n------------',name,'------------'
    print(group)

If you found this useful, please leave a comment or share this blog with others.








Thursday 26 May 2016

Tin Overlords are here

Yesterday I blogged about what work is going to look like in future, as robots start to take over.

I must correct myself. This isn't the state of work in the future. It is now.

Several articles in the news caught my attention: the first concerns a problem with unskilled workers who are demanding a minimum wage of $15/hr - they are pricing themselves out of the job market and are likely to be replaced by a Japanese robot. Do read the comments at the foot of the article - lots of commenters appear to have understood the real issue here.

The second relates to that popular thing of driverless vehicles. Volvo is pioneering its technology inside the mining industry - where there is the most to gain from driverless vehicles in terms of better human safety. But Volvo is also working towards driverless cars on the roads. In five years' time, we should expect every new car has some form of automated driver mode built in. And by the time I'm old and grey, my grandchildren may well say "I can't believe that people used to drive a car. It's so dangerous!" 

Tuesday 24 May 2016

Our new tin overlords


In yesterday's Guardian was an article about the impending takeover of robots, as described in a new and rather depressing book "Age of Em". I won't spoil the armageddon-scenarios for you. Curiously, I am reading another far more encouraging book on a similar subject, "The Second Machine Age" by MIT professors Brynjolfsson and McAfee.

Both books, consider the implications to us humans on the nature of our work. We are at a fascinating and scary point in history where computers are starting to do things that we previously thought they could never do: drive cars, play strategy games, write news. The latter book describes how we are at the start of a new industrial revolution: the coming years will transform our world in ways we couldn't possibly imagine. What will this do to our jobs?

Useful analogies can be learned from history, particularly the Industrial Revolution. Today we don't think much about the massive societal impact that the steam engine and the electric motor had on the jobs these machines replaced.  In the long term, our society will be better off. Yet it is clear that the digital age is threatening to replace today's jobs on an unprecedented scale. Will there be such a thing as a human taxi driver in 20 years? Will it be possible to do any shopping except online? Will the robots really do everything that humans do today, as suggested in the Guardian article and its book?

Fortunately, Brynjolfsson and McAfee quote some studies that look at the sorts of skills that are affected by computerization ... and the sorts of skills that are less likely to be replaced. Whilst the findings are scary, it is important to look for the good news rather than the bad news.

First, robots are very good at doing repetitive, mundane boring and predictable tasks repetitively, predictably and for long periods of time without complaining, without joining unions or without needing tea-breaks. The more mundane, the more suitable for automation. Already, robots have replaced many of these on the production-line.

Second, people are very good at interacting with other people. Any job that requires empathy, understanding, diplomacy, reading-between-the-lines, comforting, or training stands a good chance of being a future-proof job. Nursing and other healthcare jobs will reap massive benefits from technology (like this example), but I cannot see a day when suffering humans would prefer the care of a robot to the care of another human being. Jobs with a strong social element such as bar-tending, waitering, mentoring and hairdressing are also likely to survive.

Another area of work that is unlikely to be replaced by technology is the creative realm. Whilst technology will continue to cause big changes to these roles, they are unlikely candidates for electronic replacement. Jobs in education, the arts, and anything involving aesthetically pleasing results such as architecture, gardening, or cooking, have good long-term prospects.

Other roles may be more affected by technological change. As robotics and the technology we clumsily call "3D printing" develops (we should call it sculpting instead), so it will become possible for entire buildings to be constructed by a collection of machines. Construction sites are among the most dangerous work-places, and would therefore benefit greatly from robotics. Whilst a human-free building site is still in the realms of fiction, there are already machines making inroads into this industry.  The world of "unskilled labour" is perhaps the one where men will have to compete most aggressively with machines in the next decade. Yet with all the advances of mechanical mini-diggers and power-tools today, there are still plenty of jobs that are done by hand: the flexibility of a labourer over a machine is hard to beat.

So where does that leave us as a society of humans? Are we being replaced by our new tin overlords? No - we are far too inventive for that.  Our hope - and indeed the flavour of our future jobs - lies in the things that make us human, the things which separate us from robots: our creativity, our compassion for each other, and our ability to do things that have never been done before, like creating robots to do some of our work for us.