Reader small image

You're reading from  Extending Power BI with Python and R - Second Edition

Product typeBook
Published inMar 2024
Reading LevelIntermediate
PublisherPackt
ISBN-139781837639533
Edition2nd Edition
Languages
Right arrow
Author (1)
Luca Zavarella
Luca Zavarella
author image
Luca Zavarella

Luca Zavarella has a rich background as an Azure Data Scientist Associate and Microsoft MVP, with a Computer Engineering degree from the University of L'Aquila. His decade-plus experience spans the Microsoft Data Platform, starting as a T-SQL developer on SQL Server 2000 and 2005, then mastering the full suite of Microsoft Business Intelligence tools (SSIS, SSAS, SSRS), and advancing into data warehousing. Recently, his focus has shifted to advanced analytics, data science, and AI, contributing to the community as a speaker and blogger, especially on Medium. Currently, he leads the Data & AI division at iCubed, and he also holds an honors degree in classical piano from the "Alfredo Casella" Conservatory in L'Aquila.
Read more about Luca Zavarella

Right arrow

Analyzing Titanic data with plotnine

We will now demonstrate the simplicity of using plotnine for recurring tasks such as exploratory analysis.

First, you need to install the plotnine package. Here are the steps to do that:

  1. Open Anaconda Prompt.
  2. Switch to your pbi_powerqery_env environment by entering this command: conda activate pbi_powerqery_env.
  3. There are two ways to install plotnine: either install the package with the default options with a simple pip install plotnine==0.12.4 or install some extra features with pip install plotnine[all]==0.12.4 (the extra packages installed are scikit-learn and scikit-misc for loess and Gaussian smoothing). The default installation is sufficient for the code you will find in this chapter.

Then, you can import the necessary libraries and functions and load the Titanic data into the df variable with the following code:

import pandas as pd
from plotnine import (
    options, theme_tufte, ggplot, aes, geom_bar...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Extending Power BI with Python and R - Second Edition
Published in: Mar 2024Publisher: PacktISBN-13: 9781837639533

Author (1)

author image
Luca Zavarella

Luca Zavarella has a rich background as an Azure Data Scientist Associate and Microsoft MVP, with a Computer Engineering degree from the University of L'Aquila. His decade-plus experience spans the Microsoft Data Platform, starting as a T-SQL developer on SQL Server 2000 and 2005, then mastering the full suite of Microsoft Business Intelligence tools (SSIS, SSAS, SSRS), and advancing into data warehousing. Recently, his focus has shifted to advanced analytics, data science, and AI, contributing to the community as a speaker and blogger, especially on Medium. Currently, he leads the Data & AI division at iCubed, and he also holds an honors degree in classical piano from the "Alfredo Casella" Conservatory in L'Aquila.
Read more about Luca Zavarella