Basic Counting in Python

Ben Cook • Posted 2021-05-14 • Last updated 2021-10-15

I love fancy machine learning algorithms as much as anyone. But sometimes, you just need to count things. And Python’s built-in data structures make this really easy. Let’s say we have a list of strings: With a list like this, you might care about a few different counts. What’s the … Read more

Installing Packages in a Jupyter Notebook

Ben Cook • Posted 2021-01-22 • Last updated 2021-10-15

This post describes a trick for installing/upgrading Python packages in a Jupyter notebook. It’s useful for scratch code, but don’t do this when you need reproducible code.

Combinations in Python

Ben Cook • Posted 2020-12-28 • Last updated 2021-10-15

There are lots of ways to generate combinations in Python. This post will show you all of them.

Upgrading pip on macOS

Ben Cook • Posted 2020-12-27 • Last updated 2021-10-15

A few ideas if you’re having trouble upgrading pip on macOS

How to Force pip to Reinstall a Package

Ben Cook • Posted 2020-12-26 • Last updated 2021-10-15

Once in a while, a Python package gets corrupted on your machine and you need to force pip to reinstall it. As of pip 10.0, you can run the following…