Coding a BMI Calculator in Python


Coding a BMI Calculator in Python

         My Java Script BMI Calculator post, which was written a little over three years ago still generates a decent amount of traffic. We’ve also previously covered writing a VBA code for this calculation. Today we’ll try to refresh our programming skills and take a stab at building a Python version of this code. There are some great reasons why Python is overtaking R in becoming the leading programming language for data science projects. Before we delve into any data analysis type of exercise, I thought it would be helpful to get orientated to this language via easy to follow calculation: BMI = (Weight/(Height^2)) * 703.06957964 , where Weight is measured in pounds , while Height is in inches . Before we write the first line of code, one thing to keep in mind is that while Python is a fairly easy programming language to understand and follow along; it’s rather peculiar as far as indentation is concerned. Please exercise a due care to ensure that your code compiles successfully by eliminating all of the extra blank spaces in your code and following proper indentation rules.
Continue reading

Getting started with Google BigQuery and GDELT Project

Getting started with Google BigQuery and GDELT

          Once upon the time, the new kid on the block left more established search engines in the dust, then, after reinventing web-based email service, Google introduced its Apps. Today, let’s talk about one of the myriad services Google offers to us: BigQuery. Basically, this cloud-based service allows us to utilize Google’s hardware to store our own datasets or access public data on the go. Google provides API for Java, PHP, and Python access. In addition, various third-party tools now connect directly to BigQuery: Tableau, R, JasperSoft, and Simba to name a few. We get a 1 TB monthly usage quota to query BigQuery’s data for free. Some of the downsides of this service include: premiums for storing our own data and querying in excess of the free quota. We are also limited with data manipulation tasks we can perform in BigQuery; in fact, we can only append records to our table, we cannot update or delete them. Finally, this service uses a SQL language dialect, which lacks some of the SQL commands we are accustomed to: DISTINCT comes to mind, or resort us to some convoluted workarounds (try using the TOP command.) Meet, the GDELT Project – “the largest, most comprehensive, and highest resolution open database of human society ever created.” In this tutorial, we will learn some interesting facts about different countries, using GDELT data in BigQuery.

Continue reading