Skip to main content

Plotting My Google Location History

I have been using Android phones since about 2010 and for the most part of it I have had location history enabled. If you enjoy data like I do then you may agree that this service is pretty awesome because Google let's you download a copy of the data it collects from you using Google Takeout. I recently downloaded a copy of the places I have visited and got to analyzing.

My data set for the period consists of approximately 985 000 records starting from 2012-02-19. I wanted to try the out the folium plotting library which combines the data analysis strength of Python and the mapping prowess of Leaflets.js however rendering all the records on a single map proved problematic on my machine. Therefore in order to reduce the data set I used k means to assign each point to 1 of 100 clusters. After reducing the data set I then proceeded to use mean longitude and latitude per cluster as a proxy for my location history. This reduced data renders instantly and it is interactive which is pretty cool. Below are a few screen shots of the result, I haven't been to the USA yet but it somehow got in there.

I am looking forward to doing some more traveling. If anyone is interested, here is the link to the code on Github.


Popular posts from this blog

Something interesting on the side

So I have had this blog for a few years and until now I have yet to post a single article (I have never really found time or been that interested in writing a blog). Anyway I have decided that if I am to maintain a blog, or at least make a once off post, I will try keep it aligned to what I am passionate about; Data, open source and travel for now. So without further adieu I present, something interesting on the side.

While browsing /r/algotrading I came across an interesting article about identifying mean reverting spreads in US listed equities using Python. The article itself is not very detailed, but I enjoyed it none the less. My discovery of the article coincided with the start of the JSE Challenge and I thought it may be an interesting side project to build a small system/series of scripts which I could use to identify trading opportunities and then trade on them in the game. It at the very least would be good refresher in pandas and a nice way to practice writing in python.

Building Modular Web Apps with Blueprints

I was recently hacking about with the express framework in node.js. One thing I really like about it is that the request and response objects are passed into the callback of the route functions. Another thing which I thought was really awesome was the Router object. Specifically it allows you to isolate parts of your application which I like because it makes maintaining the application much easier. This got me thinking "I wonder if a similar concept exists within the Flask framework in Python?". 

Enter Flask Blueprints.Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions. I thought as a exploratory exercise I would put together a simple application using blueprints within flask.So let's build a web application which lets you post comments and displays those comments on a web page. Okay okay, this is perfectly stupid but our purpose is to learn a little about blueprints.
A Simple ApplicationFor this application we will have a single html pag…