Bridging together sets of GPS coordinates without breaking your Python interpreter

Image for post
Image for post
Image by Mohamed Hassan from Pixabay

Engineering features from latitude and longitude data can seem like a messy task that may tempt novices into creating their own apply function (or even worse: an enormous for loop). However, these types of brute force approaches are potential pitfalls that will unravel quickly when the size of the dataset increases.

For example: Imagine you have a single dataset of n items. The time it takes to explicitly compare these n items against n-1 other items essentially approaches . …


Love the simplicity of using Docker/Podman to store your machine learning environments, but need help integrating it with your NVIDIA GPU?

Image for post
Image for post
Animation created using OpenToonz and Krita.

This guide will help get you up and running to integrate your containers with a single (local) GPU directly on a Linux workstation.

Note: It does not cover the steps needed to connect to multiple GPUs over a network, nor will it help users of Windows or Mac Os (The toolkit mentioned is incompatible with those operating systems).

What you will need

  1. The proprietary graphics driver installed on your host- This already would have been needed with or without containers. …


In the last blog, I examined using ElementTree to navigate and modify XMLs and included a working example that leveraged it to overcome shortcomings on lower end smartwatches. Now, I will using explore creating a graphical user interface using TKinter, liberating it from dependence on the command line.

Image for post
Image for post
Animation created using OpenToonz and Krita.

To the programming neophyte, the notion of what goes into creating a graphical user interface can seem like an intimidating dark web of complexity. The thought can easily become overwhelming; remaining fixated on the low level “magic” and wondering “how the heck is someone supposed to turn all of those obtuse commands into a work of visual cohesion anyway?”

With the right libraries, creating a GUI really isn’t all that bad. When combined with some good foundations in object oriented programming and a bit of planning, you can be well on your way bringing to your code to life.

Introducing TKinter

To rescue my hard work from command-line-obscurity, into just plain old obscurity-obscurity, I used TKinter which is included in Python’s standard library. There are many other ways to build a Python-based GUI front end (each with their own trade-offs), but if you are a beginner, TKinter will be a solid choice that can offer a good learning experience…


A few tips on getting started and avoiding some under-documented sources of frustration.

More often than not, when you are gathering data via APIs you will be presented with the JSON format, a conveniently packaged nested dictionary (or list of them). But while the adoption of JSON is ubiquitous, sometimes you may have to work with the older XML standard.

How can you work with XML? It depends on what library you use as there are four that are frequently used. …


Errors. To us programming beginners, they may as well be as certain as death and taxes. One tiny misstep and everything falls apart. Nor only do we have our own mistakes to deal with, things can go bust when input from external factors takes an unpredictable turn.

While the frustration invoked from a misspelled variable name can be quite the buzzkill, consider the alternative. …

About

Corey Hanson

Motion graphics artist turned data scientist.

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