Practical Business Python

Taking care of business, one python script at a time

Newsletter Number 4

Sent on Wed 20 March 2019

Welcome to the fourth issue of the newsletter.

PB Python Articles

It has been a while since I sent out the newsletter so there have been a couple of new articles I wanted to point out.

  • Using The Pandas Categorical Data Type article is a follow on to the Overview of Pandas Data Types which is one of the most popular articles on the blog. Understanding and using pandas data types is important for getting the most out of the pandas library.
  • Speaking of follow-ups, I cleaned up the code to do an Excel diff so that it works with more recent versions of Pandas.
  • Finally, I had a lot of fun working on the Monte Carlo Simulation with Python article. As most of you know, I normally post the link to the articles on reddit. This particular post had some interesting comments about improving my code to be even quicker. I have also updated the post to include one example of a streamlined loop that is much faster than the original implementation.

PB Python Around the Internet

I had the distinct pleasure to be on episode #200 of Talk Python To Me. If you have not listened yet, check it out.

Site Updates

In addition to content updates, I have been working on some updates to the site that you may or may not have noticed.

First, I have switched the site to use ssl by default so all content is encrypted. Personally, I’m not sure this makes much difference for a static site such as PB Python. However chrome started marking all non-https sites as “Not Secure” which I was afraid might scare some folks away. I finally bit the bullet and made the updates several weeks ago. The additional side effect of this change is that I now use Amazon’s Cloudfront CDN to deliver content. This should make the site load faster for everyone.

Speaking of making the site better, I decided to pay the annual fee so that the disqus comments are ad free! I started looking at all the ads in the comments and realized it really distracted from the pages and I did not want them on the site. I hope everyone enjoys the ad free experience!

Finally, you may have noticed that this newsletter comes from the domain. I have set up a separate mailbox for pbpython so I am not co-mingling with my personal email. Feel free send any comments or article ideas to

Notes and Resources

Here are a few other updates in the python ecosystem.

  • I use conda for most of my day to day environment and package management. I have noticed that it can get slow over time. Thankfully the Anaconda crew is working on some solutions. This post contains a lot of details and recommendations. Additionally, miniconda is now available in RPM and Debian repos so it will be just a little bit easier to install on the Linux system of your choice.
  • If you would like to learn more about Altair, I found some nice training content that goes through the basics of how to use it.
  • This github repo contains a wealth of information about building recommender systems. I have not had the chance to play with the code but this should be great resource if anyone is thinking about building a recommender system.
  • Speaking of recommender systems, I had the pleasure of attending a meetup where Seth Kelly spoke about his beer recommender project. There is a lot of really interesting python code and machine learning principles in this project.
  • Python’s dir function is really useful when trying to learn a new library. This simple dir improvement called mydir looks like a nice tool to make the dir output just a little more readable.

A Quick Code Tip

This tip comes via a tweet from Peter Baumgartner. He mentions the idea that you can use slugify to quickly and easily clean up column names in pandas. I think this is a great idea and wanted to pass it on.

Wrapping It Up

I hope you enjoyed the latest newsletter. Feel free to forward to those that might find this interesting. You can sign up here if you are not a subscriber.