Chapter 9Data Visualization
In this chapter you continue with the AdventureWorks data analysis scenario by learning how to use one of Python in Excel’s most powerful capabilities: visually analyzing data.
As you will see in this chapter, Python in Excel can produce charts (i.e., data visualizations) that are difficult, or impossible, to replicate using out-of-the-box Excel features.
9.1 INTRODUCING PLOTNINE
Like Microsoft Excel, Python has rich support for crafting data visualizations that help you analyze data and tell data stories. Over the years, many Python libraries have been built for visualizing data. Examples include the matplotlib and seaborn libraries.
Data visualization is so important in real-world analytics that the pandas library also offers charting functionality (e.g., creating a bar chart of a column). However, in this chapter you learn about my go-to library for data visualizations with Python in Excel – the mighty plotnine.
As a quick aside on terminology, I treat the terms chart, visual, visualization, and data visualization as synonymous in this chapter.
One of the goals of the plotnine library is to produce print-quality visualizations (e.g., for academic journals). This means that plotnine is very flexible and offers a lot of control over your data visualizations – far more than provided by Excel charts.
This is important to note because when I teach plotnine I often get asked, “Dave, can I use plotnine to do X?” The answer is plotnine can do just ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access