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

Working with Google Sheets’ QUERY Function


Using QUERY Function in Google Sheets

          So far we’ve covered some ground when it comes to using spreadsheet functions within MS Excel ecosystem. Perhaps it’s time to turn to one of its leading competitors: Google Sheets ? When GoogleSheets was launched noone, but perhaps its creators would seriously consider it to be a real threat the mighty, ubiquitous Excel spreadsheet package. Over the years this product went through a plethora of incremental, as well as break-through enhancements. By now GoogleSheets achieved an admirable user base backing it’s strong functionality matching and in some instances surpassing the gold standard continuously maintained by the much beloved Excel program.

          One of most versatile Sheets’ functions is the QUERY function. Its SQL-like syntax allows us to retrieve specific information from our worksheet, enabling various filtering, sorting, lookup, and aggregation capabilities. While this function is more powerful than INDEX/MATCH, VLOOKUP, SUMPRODUCT, SUMIFS and others, its syntax is rather simple: QUERY(Data, Query, [Headers]) .

Data – range of cells we want to query from

Query – actual query code, to be enclosed in quotation marks or be a reference to a cell containing query text.

Headers – OPTIONAL, number of header rows at the top of data, when omitted value is set to -1.

          If you can comfortably compose basic SQL queries, you will find this function rather intuitive and easy to use. However, you might also find yourself wanting to throw your keyboard across the room when some of the SQL functionality we take for granted is either not found or not implemented properly in this function. Working with aliases has definitely topped my personal list of annoyances.
Continue reading

First Impressions of using Qlik Sense cloud, using Survey of Business Owners data


First Impressions of using Qlik Sense cloud, using Survey of Business Owners data.

          There is certainly no shortage of various data visualization and BI tools on the market. On this blog we’ve already covered Tableau and Power BI , it’s time for us to review their competition, another leader on Gartner’s Magic Quadrant for Analytics and BI platforms: Qlik , which offers a suite of different BI tools. For the purposes of this post let’s focus on their web-based free product: Qlik Sense – Cloud. Most of the modern data viz programs are supposed to be rather intuitive and very easy to use; so I decided to play with this program without going through the trouble of learning to use it first. American data finder had just the right data set for this experiment: Survey of Business Owners data, which among other things can help us quantify number of companies by size and owner’s gender, see if male vs. female-owned organizations earn higher revenue, employ more workers, and/or pay higher salaries to their employees. Let the data discovery journey begin.

Continue reading

Getting started with Microsoft Power BI using Google Merchandise store data.


Getting started with Microsoft Power BI using Google Merchandise store data

          While I’m as loyal to Excel as the next analyst, when it comes to data visualization and interactive dashboards, Tableau is my tool of choice. If I need to analyze large data sets, I prefer to get cozy with the data by writing SQL queries in whichever database environment such data might be stored. In the meantime, the world does not stand still, and Microsoft has been making substantial progress with a product offering they called Power BI . In fact, this tool offers data preparation, data discovery, dashboarding and custom visualization features starting with a free version for up to 1 GB of stored files and a modest $10 monthly plan for the beefed up PRO version. It’s definitely long overdue, but I finally got around to playing with both: Power BI desktop and cloud-based versions, all while using publicly available data from nonetheless, but Google’s merchandise store. , available through their demo Google Analytics account. Which other etailer can boast growing their Cyber Monday sales by 274% to $54K, while keeping their marketing advertising budget under $ 100?

Continue reading