From Ad-hoc to App.
In my two previous blog notes I did discuss the three types of Analytics Ad-hoc , Software (App) and hybrid.
In this blog note we will do a little bit more of analysis on the business license data from the City of toronto to help someone who is not necessarily a python programmer to analysis on the city open data by creating an interface.
Creating a user interface
Python has a few libraries that allows the creation of some interesting user interface widgets, I have chosen ipywidgets just to illustrate the ability to create a user interface that allows the user to do the following on the Data.
- Select a certain category of licenses to view
- Select a 3 Letter postal code (representing the area) or ALL for the whole city.
- Use sliders to decide the year range he wants to look at.
So let us look at the ‘Greek Resturant’ scene in Toronto by focusing our search on the Danforth area for example (using Postal code M4K , see map below).
Using the widgets “Interact” capabilities of python, Once you select the Category, range and Postal, you will immediately see the plots showing you the results.
- Number of Issued licenses per year
- Number of Canceled licenses per year
- The total (issued-canceled) of new business open in the postal code per year.
Now compare that to analysis to the restaurants
/eating establishments at the heart of the business area downtown for that Analysis we will use the postal code M5V (see map to the right).
And we will focus our search on the 10 years period between 2004 and 2014.
The graphs tell a story of two areas that respond to different events in different ways, it is obvious that in 2005 there was a change of licensing requirements that increased ‘cancelations’ all over the city but the Danforth was less resilient to licensing changes, but when the Economic crisis of 2008 hit, the downtown core as severely affected while the danforth absorbed the shock relatively well, and most negative impact was also shifted 1 year later with a very strong rebound in 2010.
One of the features that will be useful for such analysis is to allow the users to print the numerical data used for the graphs.
issued canceled total year 2004 75 46 29 2005 59 72 -13 2006 99 85 14 2007 62 90 -28 2008 53 114 -61 2009 61 59 2 2010 61 51 10 2011 66 45 21 2012 54 50 4 2013 50 53 -3 2014 63 49 14
Using the notebook and next steps.
If you want to run some of those analysis yourself you can download the zip file from github
Use the ‘User Ready Business License Explorer’ notebook.
You will need the following libraries installed (the easiest way is using pip).
But what about those who want to use these data ?
The next challenge will be delivering this solution without requiring the user to install iPython, Pandas, numpy, iwidgets, etc. and that will be the topic of my next post.