A Byte of my 2.2-lb Brain

Just sharing stuff…

Web Scraping the MMDA Traffic Updates

Metro Manila Traffic Rhythm Thanks to a good friend and colleague**, last week, I learned about the existence of the Metro Manila Development Authority Live Traffic Monitoring System. Below is … Continue reading

September 1, 2015 · Leave a comment

h2o.ai and Python

One of the awesome things I discovered this year is H2O.ai. According to its homepage, H2O is for data scientists and application developers who need fast, in-memory scalable machine learning … Continue reading

August 19, 2015 · Leave a comment

Python Built-In Function Zip

Say you have a list of lists stored in mylist. Here are some useful methods to play with the data inside. Output: [[1, 5, 9, 11, 18], [2, 4, 10, … Continue reading

June 25, 2015 · Leave a comment

GraphTool Vertex Attributes

It did take me some time to figure out how to obtain a node’s attribute is using Python’s graph-tool package. In this example, we have a directed graph g with … Continue reading

June 23, 2015 · Leave a comment

PyPI Dependency Network

The Python Package Index is a repository of software for the Python programming language. What my colleague Ed David and I did were mine all the packages in the site … Continue reading

June 23, 2015 · 1 Comment

Finding all hashtags in a list of tweets

June 15, 2015 · Leave a comment

Twitter Datetime

Twitter’s “CREATED_AT” format looks something like this Wed Mar 04 02:14:57 +0000 2015. To convert this to Python’s datetime format, simply use datetime.strptime(). If the tweets are stored in a … Continue reading

May 28, 2015 · Leave a comment

Obtaining Geolocation Details using GeoPy

The variables cdo, manila, and cebu are of type geopy.location.Location with the following attributes: address, altitude, latitude, longitude, point, and raw. To access these information, for Cagayan de Oro, for … Continue reading

May 17, 2015 · Leave a comment

Add Multiple Columns to Pandas Dataframe from Function

If you have a pandas data frame mydf that has, for example, two columns mydate and mytime (both are of type datetime), to add three more columns: hour, weekday, and … Continue reading

May 5, 2015 · Leave a comment

GraphTool

For a few years now, I have been using NetworkX in all works related to networks. It’s a beautiful Python package and I love it. NetworkX is a Python language … Continue reading

April 28, 2015 · Leave a comment