Be yourself; Everyone else is already taken.
— Oscar Wilde.
This is the first post on my new blog. I’m just getting this new blog going, so stay tuned for more. Subscribe below to get notified when I post new updates.
Be yourself; Everyone else is already taken.
— Oscar Wilde.
This is the first post on my new blog. I’m just getting this new blog going, so stay tuned for more. Subscribe below to get notified when I post new updates.
The London underground system is the oldest underground metro in the world.
It consists of 11 lines linking 270 stations. In 2017/18 it carried nearly 1.4 billion passengers
For my Capstone project, I will be looking into the neighbourhoods that each station is found in. By analyzing the venues surrounding each station I will be able to group them and also determine what is their primary usage, whether they serve an area which is mostly residential, office, commercial based etc.
The target audience for this analysis would be TfL (Transport for London) and local government for town planning purposes. It will show what the system is being used for, how people travel from home to work or entertainment, and where expansion of the network may be required.
The data I will require to execute this project will include:
Based on the primary venue types surrounding each station I will be able to do a cluster analysis to identify groups of stations and examine what these groups have in common / what differentiates them from other groups.
In the first place we used a module called BeautifulSoup to scrap the table of station names along with the latitude and longitude values from the wikipedia page mentioned above. We limited ourselves to the columns which were required for our analysis and converted it into a dataframe. Some wrangling was necessary where the table included duplicate values and explanatory text in numerical columns.
Once we had the dataframe of stations with their geo-locations, we created a function to call the Foursquare API and query the total results for each high level category of venue within a given radius of each station. The function updated a new dataframe to show the totals of each venue type alongside each station.
Now we had a usable dataset showing the list of stations, their geo-locations and the totals for each venue type surrounding them. We transformed this into an array and scaled it so that it was possible to create boxplots using the module seaborn for the numbers of venue types on both an absolute and a relative basis. We also ran a K-means cluster on the dataset to group the stations into 5 clusters based on the total number of venue types surrounding them.
By adding the cluster labels back onto the dataset of station names and geo-locations, we used the folium module to create a map of London and superimpose the stations, colour-coded to show where the clusters lie.
From our first analysis of the number of venue types it was clear that the category of “Food” has the highest number of venues in London. Several categories such as Arts, Educational and Residential were significantly lower, and the more commercial venue types had significantly more ratings. This is probably because the primary way people use Foursquare is to rate commercial locations rather than every building.

When we clustered our stations we saw the following:

We can characterise these clusters as follows:
If we plot the stations on a map and colour code them by the clusters we just discussed then the picture becomes clearer:

There are a number of limitations to this analysis that should be borne in mind related to the fact that it relies entirely on the Foursquare data.
Firstly, Foursquare does not represent everything. It is to be expected that the highest number of venues to be found are food and other commercial venues, since people use the service to rate and review places where they have spent money. It is likely that since people do not rate every single building, categories such as residential in particular will be significantly underrepresented.
Secondly, Foursquare does not account for the sizes of venues. A large university in one part of London may educate and house thousands of students but it will only count as 1 venue, just as each ice cream kiosque or burger stand will count as 1 venue despite being many times smaller.
Despite the limitations of the Foursquare data discussed above, it was possible to identify general areas of London and characterise them based on the kinds of venue that proliferate in them. Further analysis could be based on the number of addresses in each postcode to try to cross reference that to find the hidden venues, or some kind of weighting based on venue size could be attempted.
This is an example post, originally published as part of Blogging University. Enroll in one of our ten programs, and start your blog right.
You’re going to publish a post today. Don’t worry about how your blog looks. Don’t worry if you haven’t given it a name yet, or you’re feeling overwhelmed. Just click the “New Post” button, and tell us why you’re here.
Why do this?
The post can be short or long, a personal intro to your life or a bloggy mission statement, a manifesto for the future or a simple outline of your the types of things you hope to publish.
To help you get started, here are a few questions:
You’re not locked into any of this; one of the wonderful things about blogs is how they constantly evolve as we learn, grow, and interact with one another — but it’s good to know where and why you started, and articulating your goals may just give you a few other post ideas.
Can’t think how to get started? Just write the first thing that pops into your head. Anne Lamott, author of a book on writing we love, says that you need to give yourself permission to write a “crappy first draft”. Anne makes a great point — just start writing, and worry about editing it later.
When you’re ready to publish, give your post three to five tags that describe your blog’s focus — writing, photography, fiction, parenting, food, cars, movies, sports, whatever. These tags will help others who care about your topics find you in the Reader. Make sure one of the tags is “zerotohero,” so other new bloggers can find you, too.
Have a WordPress.com account? Log in now.