Seaborn is one of the go-to tools for statistical data visualization in python. It has been actively developed since 2012 and in July 2018, the author released version 0.9. This version of Seaborn has several new plotting features, API changes and documentation updates which combine to enhance an already great library. This article will walk through a few of the highlights and show how to use the new scatter and line plot functions for quickly creating very useful visualizations of data.
Python has many options for natively creating common Microsoft Office file types including Excel, Word and PowerPoint. In some cases, however, it may be too difficult to use the pure python approach to solve a problem. Fortunately, python has the “Python for Windows Extensions” package known as pywin32 that allows us to easily access Window’s Component Object Model (COM) and control Microsoft applications via python. This article will cover some basic use cases for this type of automation and how to get up and running with some useful scripts.
This article is a review of Chris Albon’s book, Machine Learning with Python Cookbook. This book is in the tradition of other O’Reilly “cookbook” series in that it contains short “recipes” for dealing with common machine learning scenarios in python. It covers the full spectrum of tasks from simple data wrangling and pre-processing to more complex machine learning model development and deep learning implementations. Since this is such a fast moving and broad topic, it is nice to get a new book that covers the latest topics and presents them in a compact but very useful format. Bottom line, I enjoyed reading this book and think it will be a useful resource to have on my python bookshelf. Read on for some more details about the book and who will benefit most from reading it.
In my last article, I presented a flowchart that can be useful for those trying to select the appropriate python library for a visualization task. Based on some comments from that article, I decided to use Bokeh to create waterfall charts and bullet graphs. The rest of this article shows how to use Bokeh to create these unique and useful visualizations.
This brief article introduces a flowchart that shows how to select a python visualization tool for the job at hand. The criteria for choosing the tools is weighted more towards the “common” tools out there that have been in use for several years. There may be some debate about some of the recommendations but I believe this should be helpful for someone that is new to the python visualization landscape and trying to make a decision about where to invest their time to learn how to use one of these libraries.
When doing data analysis, it is important to make sure you are using the correct data types; otherwise you may get unexpected results or errors. In the case of pandas, it will correctly infer data types in many cases and you can move on with your analysis without any further thought on the topic.
Despite how well pandas works, at some point in your data analysis processes, you
will likely need to explicitly convert data from one type to another. This article
will discuss the basic pandas data types (aka
dtypes), how they map to
python and numpy data types and the options for converting from one pandas type to another.
Jake VanderPlas covered this topic in his PyCon 2017 talk and the landscape has probably gotten even more confusing in the year since this talk was presented.
Jake is also one of the creators of Altair (discussed in this post) and is back with another plotting library called pdvega. This library leverages some of the concepts introduced in Altair but seeks to tackle a smaller subset of visualization problems. This article will go through a couple examples of using pdvega and compare it to the basic capabilities present in pandas today.
I recently had the need to take a couple pages out of a PDF and save it to a new PDF. This is a fairly simple task but every time I do it, it takes some time to figure out the right command line parameters to make it work. In addition, my co-workers wanted similar functionality and since they are not comfortable on the command line, I wanted to build a small graphical front end for this task.
One solution is to use Gooey which is a really good option that I cover in my prior article. However, I wanted to try out another library and decided to give appJar a try. This article will walk through an example of using appJar to create a GUI that allows a user to select a PDF, strip out one or more pages and save it to a new file. This approach is simple, useful and shows how to integrate a GUI into other python applications you create.
Over on Kaggle, there is an interesting data set of over 130K wine reviews that have been scraped and pulled together into a single file. I thought this data set would be really useful for showing how to build an interactive visualization using Bokeh. This article will walk through how to build a Bokeh application that has good examples of many of its features. The app itself is really helpful and I had a lot of fun exploring this data set using the visuals. Additionally, this application shows the power of Bokeh and it should give you some ideas as to how you could use it in your own projects. Let’s get started by exploring the “rich, smokey flavors with a hint of oak, tea and maple” that are embedded in this data set.
It is difficult to write a python script that does not have some interaction with the file system. The activity could be as simple as reading a data file into a pandas DataFrame or as complex as parsing thousands of files in a deeply nested directory structure. Python’s standard library has several helpful functions for these tasks - including the pathlib module.
The pathlib module was first included in python 3.4 and has been enhanced in each of the subsequent releases. Pathlib is an object oriented interface to the filesystem and provides a more intuitive method to interact with the filesystem in a platform agnostic and pythonic manner.