The geography of counties and county-level equivalents are often oddly-shaped and meandering. A smaller county may be nearly-if-not-completely surrounded by a larger, separate jurisdiction. Using a centralized pair of longitude and latitude coordinates to describe the location of the larger county might, instead, locate a point in the middle of the smaller county. Fortunately, there are ways to get around this problem.
In this article, we will explore the following:
If you are only looking for instructions on accessible ways to visualize worldwide or country-level geodata, you are in luck. There is no shortage of relevant software and library documentation and tutorials. Information can be a bit more sparse if you are looking into ways to visualize data on a county level. …
Local environment variables are useful for storing credentials on a local machine. Your operating system uses them to identify things like the location of your temporary directory or your Python installation path. You can also use them yourself in code.
In Python, you can reference environment variables without exposing their values to users on other machines. This can be handy when your code requires you to sign in to a service or log in to a private server.
You can not only access environment values using Python, but you can also create them (sort of).
Let’s see how we can set and get environment variables with Python. …
In the previous article, we obtained CSV data via download to approach an understanding of United States Census Bureau data tables with the ultimate goal of learning about discrepancies in broadband internet access. In the process, we saw that working with data sometimes requires many steps before we even begin typical data preparation tasks. The present article continues our study in advance of using geospatial visualization to explore our data and consider opportunities for predictive analysis.
Here we will focus on the following:
This article is the first in a series looking into strategies for exploring United States Census Bureau public data with Python. We will first preview data via online tools and then obtain CSV data via download to gain an understanding in Pandas. In a subsequent article, we will build a customized API call, obtain a key, and import data via API. We will then use geospatial visualization to explore our data and consider opportunities for predictive analysis.
Much of what I have discovered or experienced in the areas of data science and analysis might have been much more difficult for me to realize without reliable access to the internet. Downloading datasets, collaborating and sharing-work via online repositories, and experimenting with open source tools have all been made possible via access to the internet. And while it pains me to no end when weather or a maintenance event interrupts my online-access for even one hour in a single month, many have it much worse. …
I know it’s important to put first things first, but sometimes the next thing just seems so much cooler.
For me, the next thing is professional team data projects. Sometimes there seem to be an awful lot of ‘first-things’ ahead of it.
Have you ever planned a road trip weeks and advance and then, when you are all packed up and ready to go on the day-of, you realize that one of your tires is under-inflated, your fuel tank is nearly empty, and you forgot to pack any snacks?
Anyhow, it is important to stay inspired. Accordingly, I spend at least half-an-hour of each day reading data-related blogs or skimming data science repositories. There is a lot of interesting work being done, recorded, and written about. …
In the previous article, we discussed how a simple URL edit enables us to view and run Jupyter notebook code from a GitHub repository on a smartphone. But what do we do when we need a dataset from the repo to run the code?
Let’s look at a quick example of how a simple line-or-two of Python code makes it possible to add a dataset to our cloud notebook.
In this article we will demonstrate the following:
I regularly read articles on Python projects coded in Jupyter notebooks where the author includes a link to the project’s Github repository. Sometimes, I want to see the code in action for myself. For example: If the code includes a snippet, practice, or visualization that I am interested in trying out in my own work, I may want to validate that the code is up to date with currently available libraries.
One way to test the code is to create a fork of the repository on my own profile, which has the advantage of copying any data and supporting files included in the original repo. But sometimes, if the dataset is small or if I just want to render a notebook visualization that does not show on Github, I would rather just open the notebook online without having to clone it locally. …
If you write python code requires you to enter a private Application Programming Interface (API) key or secret credential, you will want to hide this information from your code before posting it to a public repository. One of the easiest ways to handle this is by creating a
APIs enable applications to communicate with one another. An API key is a unique identifier that indicates rights and permissions available to you — the calling user or application. The key determines how you are able to interact with an endpoint’s data. …
You know that road-trip game, where you only count cars you see if they are of the same color. On a long, lonely stretch of road, it is a game of anticipation. On a busy highway, it can get a bit neurotic. Sometimes, the game can morph into one of comparing how many different colored cars you can count. Without some sort of tally sheet, keeping count in this way quickly can get out of hand. Even if you make a list comprising each observation, counting them up for each category can be a bit of a hassle.
A digital list can be just trying. You may be able to highlight or sort a spreadsheet list, to make counting a little easier, or perhaps you could aggregate fields in a SQL database. In Python, you also have a few options for managing such a task. …
I like to learn about different tools and technologies that are available to accomplish a task. When I decided to explore data regarding COVID-19 (Coronavirus), I knew that I would want the ability to present visualizations interactively. After all, the Coronavirus pandemic is tracked, monitored, and reported daily, from all over the world. Data science and analysis projects that involve temporal data lend themselves well to interactive plotting and timeline animation.
To support the desired interactive capabilities, notebooks for this project were composed in Deepnote, an online, Jupyter-style environment that enables the publishing of complete Python notebooks that retain interactive outputs. The Plotly Express library was used to produce interactive plot objects. …