How to set the title and fonts of your Seaborn Chart?

In today’s recipe we’ll learn about Seaborn title objects for charts and axes. We’ll see how we can quickly set and change them and apply some customization to improve your Python charts look and feel. Using set_title to add a title to your chart Seaborn leverages the Matplotlib plt.set_title method to define your chart title … Read more

How to load a text file into Pandas?

In this recipe we’ll look into the topic of loading text files in Pandas dataframes. for further data wrangling for visualization purposes or as a preparatory step for Machine Learning. Use pd.read_csv() to load text file with tab delimiters Let’s outline this using a simple example. Suppose we have a text file that has several … Read more

Add Python lists as columns in Pandas DataFrames

Our quick data wrangling recipe today covers the topic of adding Python lists to Pandas DataFrames as columns and rows. Creating the data We’ll start with a simple dataset that we’ll use throughout this tutorial examples. Go ahead and copy this code into your data analysis Python environment. Let’s also define a simple list for … Read more

How to create a Pandas barplot?

In today’s recipe we’ll learn about how to quickly draw barplots to analyze data which we already acquired into a Pandas DataFrame. We’ll look into several scenarios: Simple bar chart Using groupby to summarize values in our chart. Horizontal and Stacked Charts Formatting options: color maps, titles, font sizes, labels, etc’ Data Preparation Let’s start … Read more

How to count unique values in a Pandas Groupby object?

Today’s Python data wrangling recipe is about counting number of non unique entries in a Pandas DataFrame groupby object. We’ll start by importing the Pandas library and then acquiring our dataset from a comma separated value file into a DataFrame. We’ll use the Pandas read_csv function: Let’s take a quick look at the DataFrame Header: … Read more