Using Python & Web Scraping to compare the best choices

Fantasy Football 2020 QB Comparisons

Using Python & Web Scraping to compare the best choices

It’s that sweet and sour time of year where the end of summer is looming over all of us, but that means that football season is just around the corner. Every year, millions of people indulge in the fantasy football frenzy which involves an endless amount of personal strategies, gut feelings, and intuitive analysis strategies. I wanted to use some web scraping and Python analytical skills to build a cool visual representation of how some quarterbacks compare to each other before the drafting season begins.

Web Scraping — BeautifulSoup

To begin, we need to get ourselves some data. We will be using Python’s BeautifulSoup…


Using JSON & Pandas To Gather Information

There is a plethora of financial data available nowadays and seemingly even more places to source that data from. There are countless different methods to go about gathering data, many of which require third party API’s which must be installed to your system in order to make the necessary API calls. In this quick notebook walkthrough, we will demonstrate how to perform a simple JSON web scrape to fetch the data and then organize it into a pandas DataFrame. We will then use the Python library Plotly to visualize the indicators.

Importing Libraries

import pandas as pd import requests import json import…


Tableau Dashboard to illustrate key statistics for this year

As mentioned in some of my previous blogs, I have been using the 2019–20 NHL hockey statistics and data files to reinforce new skills in Tableau. The data is made available thanks to moneypuck.com. I decided to create the visualization as a scatter plot with an X and Y axis each containing a respective statistic. This method of plotting the key statistics allow for the user to get a detailed directional view of the statistic relationships as well as overall distributions of the league goalies.

Unfortunately, embedding the dashboard isn’t possible because I use Tableau Public. Below is a snapshot of the tableau dashboard and the full version can be found here.


Quick Reference for choosing hypothesis tests

Photo by timJ on Unsplash

When working with large datasets, multiple features can have any range of values with even more ambiguous relationships. Even with a concrete domain knowledge, data workers are expected to have a firm and accurate understanding of what composes the data values. Hypothesis Testing allows for the firm and statistically significant support of a data problem or solution. Let’s take a look at the situations which warrant the usage of some of the fundamental hypothesis tests.

Null & Alternate Hypothesis

  • Null Hypothesis: There is no significant difference in a set of observations: “Two sample means are equal”
  • Alternate Hypothesis: “Two sample means are not equal”


Updating a GitHub Repository via the Terminal

Version Control is an absolutely critical component to developing that every coder should be familiar with. Version Control is a logging system which records the history of your code so that the entire progression can be available at a later time. Version control allows for developers to write, change, delete, and edit new and existing code while keeping a detailed record of all the different “versions” of our file(s). In particular, GitHub uses the version control system “Git”, which is what we will focus on in this post.

Photo by Yancy Min on Unsplash

Local vs Remote

There are two main types of version control systems: local and remote…


Using a Monte Carlo Simulation to forecast Financials

The DCF (Discounted Cash Flow) Valuation model is perhaps the single most important financial tool that financial professionals can have. This model is great in theory and practice, but traditionally performed in excel, it can be quite tedious and cumbersome in function at times. Fortunately, using Python, we can automate many of these valuation steps and then also take it a step further and create a Monte Carlo Simulation function which will be used to visualize distributions of potential DCF outcomes.

Photo by Carlos Muza on Unsplash
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline

The first thing we need…


Using Pyfinmod for quick financial information

Photo by Kelly Sikkema on Unsplash

Whether it’s for personal or professional reasons, financial confidence and security are essential. There are often fundamental questions that require a few tedious calculations to develop a good understanding of what the current state of one’s financials are, and what they will turn into. Things like interest rates, premiums, and compounding cash flows will all alter the way one lives their life. These calculations, while not necessarily complicated, can get a little confusing at times. Fortunately, I recently came across a great financial module, Pyfinmod, which can quickly expedite some of these calculations. …


An interactive look at top performers before the playoffs

Photo by Anders Krøgh Jørgensen on Unsplash

As I mentioned in a previous post, I decided to take advantage of the time off during quarantine to learn new methods and applications for the manipulation and presentation of all types of data. Fortunately for me, Tableau was generous enough to make their entire e-learning platform free for a limited time so I decided to take full advantage and complete the Tableau Data Analyst course using Tableau Public (the professional service is just way too expensive for casual at-home use). Tableau is truly an incredibly powerful and customizable experience for exploring and crafting meaningful data insights.

The large majority…


Getting Familiar with Python’s Key Components

Before one can hop into the ambiguous world of data wrangling, manipulation, and modeling in Python, one must first become extremely comfortable working with the most basic elements of Python. Understanding how data is stored and operated on within the Python environment will determine the functionality, speed, and effectiveness of your code. One of the cornerstone elements of a strong Python foundation is the use of dictionaries. Python dictionaries exist in key-value pairs, meaning that data objects are specified by their key, and their values are then associated with that key. Let’s take a look at what that means:

andrew…


Using Python to Create a Moving Average Trading Strategy

As someone who comes from an economics background, I can’t help but think of the world through a financial lens. When I decided to transition towards technical analysis I still wanted to incorporate my financial domain knowledge in to the technical components. Technical Analysis in trading is a very hot area for many in my position, so I wanted to build a quantitative trading strategy with backtesting to combine the two areas. The full repository for this project can be found here.

Photo by Jason Briscoe on Unsplash
  • *Disclaimer: This blog and trading strategy are for educational purposes and I do not recommend usage for professional…

Andrew Cole

Using Data Science to drive curiosity.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store