Create a Seaborn countplot using Python: a step by step example

In today’s tutorial we would like to run through a detailed end to end example of Seaborn countplots creation and customization. We’ll be using our deliveries DataFrame as an example. You can grab the file from this location. Step 1: Import thew example dataset Step 2: Create a Seaborn Countplot chart We’ll start by rendering … Read more

How to customize Matplotlib plot titles color, position and fonts?

In today’s quick recipe, we’ll learn the basic of Matplotlib title customization. We’ll use bar plots, but the post is fully relevant for other Matplotlib charts: line, scatter, distribution and bar plots. Step 1: Prepare your data for visualization We’ll start by defining a simple dataset for this example. We got a Pandas Series that … Read more

How to export a Python Dataframe column to a list?

This quick tutorial will cover the topic of writing a DataFrame column to a Python list. Consider the following code snippet: Here’s our DataFrame header: manager target 0 Debbie 32000 1 Daisy 45000 2 Dorothy 18000 3 Tim 20000 4 Debbie 32000 Using pd.DataFrame.tolist() to write column to a list Here’s the Python code you’ll … Read more

Pandas: how to plot timeseries based charts?

In this quick recipe we’ll learn how to quickly create a chart that displays time series key performance indicator data. Let’s quickly start by creating some random data for this exercise: Here’s our dataframe header: time sales 0 2020-01-01 79 1 2020-02-01 91 2 2020-03-01 87 3 2020-04-01 74 4 2020-05-01 66 Using DataFrame.plot() to … Read more

Rotate axis tick labels in Seaborn and Matplotlib

In today’s quick tutorial we’ll cover the basics of labels rotation in Seaborn and Matplotlib. For convenience examples will be based on Seaborn charts, but they are fully relevant to Matplotlib. Here’s a Python snippet that builds a simple Seaborn barplot (sns.barplot). I assume that you have already imported Matplotlib and / or Seaborn to … Read more