COVID-19 Cases by County in the U.S.

Visualizing Geographic Data with Python

COVID-19 Cases by County in the U.S.

Finally, I reached the end of a rather turbulent academic term and have made the time to look through some COVID-19 data. Better late than never, right? Now in June, it seems the peak of COVID is behind us and almost every state in the U.S. has started to relax COVID-related restrictions. A few states have even lifted restrictions completely.

For my research work, I have recently needed to develop some geographic data processing and visualizing skills. The available tools have really impressed me, so this post is dedicated to showcasing some of them. Since my research is not yet at a stage where I should be sharing results, I figured that COVID should suffice as an interesting and probably more relevant topic. So specifically, this post provides step-by-step instructions on how to produce this spatiotemporal COVID-19 illustration, a sample of which is shown below, using primarily the pandas and plotly Python packages. Note that the full illustration has an interactive time element and may take a moment to fully load, as it is a large file.

[Read More]

PEP572 -- Assignment Expressions

The Walrus Operator & Application to Newton's Method

PEP572 -- Assignment Expressions

This past week saw the debut of PEP572 in the release of Python 3.8.0. A PEP is a Python Enhancement Proposal, a document that describes a feature and requests its incorporation into the Python language. Now PEP572 in particular was about as controversial as they come, so much so that it caused Guido von Rossum, the original author of Python, to step down from his role as Benevolent Dictator for Life and form a committee to replace him. Yikes!

[Read More]

The 0-1 Knapsack Problem

Building a Dynamic Programming Solver in Python

The 0-1 Knapsack Problem

The knapsack problem is textbook material in fields like computer science, mathematics, operations research, etc., and I find it compelling for two main reasons. First, it is easy to describe in words, yet not so easy to solve. Second, in addition to being textbook, it is applicable to a variety of everyday situations.

[Read More]

Python Tools for Math Modeling

The 'itertools' Package (ft. Matt Damon & Long John Silver)

Python Tools for Math Modeling

This past week, I contemplated a number of math modeling applications for publication here. Ultimately, I decided to instead write about my approach to implementing math models, specifically in cases where Python’s itertools package can work its magic. The itertools package is part of the Python standard library which is itself enormous. Tack on all the high-quality 3rd-party math packages (e.g. numpy, pyomo, etc.), and finding the best tool for the job often requires more effort than simply using the tools you already know. This post is a little bit about prefacing future math modeling posts, but is mostly geared toward expanding your arsenal at a low investigative cost.

[Read More]