Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Dive Deeper into Visualization | Explore Dataset
Introduction to Python for Data Analysis
course content

Contenido del Curso

Introduction to Python for Data Analysis

Introduction to Python for Data Analysis

1. Introduction to Python 1/2
2. Introduction to Python 2/2
3. Explore Dataset
4. Becoming an Analyst

Dive Deeper into Visualization

Let's imagine that it is essential for you to sort out the user continued subscription after the trial period. Let's move to the dataset that we use, for example:

Look at the code:

As you can see, we just add the hue parameter, which helps you sort out data by categories. For instance, here, hue = 'trial', the column 'trial' has two categories: True and False.

And here is the output:

barplot

Tarea

Visualize the sum of money you receive from users depending on their subscription plan. Take into account if the user continued the subscription after the trial period.

  1. Import the seaborn with the sns alias.
  2. Import the matplotlib.pyplot with the plt alias.
  3. Prepare data for visualization using the .groupby() function:
  • Extract columns 'plan', 'price', 'trial' for grouping
  • Group by column 'plan' and then by 'trial'.
  • Calculate the sum of all prices for each plan.
  • Reset indices.
  1. Create the barplot using the seaborn:
  • Use df as the data argument.
  • Use the 'plan' column for x-axis.
  • Use the 'price' column for y-axis.
  • Use the 'trial' column for hue variable.
  1. Display the plot.

Tarea

Visualize the sum of money you receive from users depending on their subscription plan. Take into account if the user continued the subscription after the trial period.

  1. Import the seaborn with the sns alias.
  2. Import the matplotlib.pyplot with the plt alias.
  3. Prepare data for visualization using the .groupby() function:
  • Extract columns 'plan', 'price', 'trial' for grouping
  • Group by column 'plan' and then by 'trial'.
  • Calculate the sum of all prices for each plan.
  • Reset indices.
  1. Create the barplot using the seaborn:
  • Use df as the data argument.
  • Use the 'plan' column for x-axis.
  • Use the 'price' column for y-axis.
  • Use the 'trial' column for hue variable.
  1. Display the plot.

¿Todo estuvo claro?

Sección 3. Capítulo 17
toggle bottom row

Dive Deeper into Visualization

Let's imagine that it is essential for you to sort out the user continued subscription after the trial period. Let's move to the dataset that we use, for example:

Look at the code:

As you can see, we just add the hue parameter, which helps you sort out data by categories. For instance, here, hue = 'trial', the column 'trial' has two categories: True and False.

And here is the output:

barplot

Tarea

Visualize the sum of money you receive from users depending on their subscription plan. Take into account if the user continued the subscription after the trial period.

  1. Import the seaborn with the sns alias.
  2. Import the matplotlib.pyplot with the plt alias.
  3. Prepare data for visualization using the .groupby() function:
  • Extract columns 'plan', 'price', 'trial' for grouping
  • Group by column 'plan' and then by 'trial'.
  • Calculate the sum of all prices for each plan.
  • Reset indices.
  1. Create the barplot using the seaborn:
  • Use df as the data argument.
  • Use the 'plan' column for x-axis.
  • Use the 'price' column for y-axis.
  • Use the 'trial' column for hue variable.
  1. Display the plot.

Tarea

Visualize the sum of money you receive from users depending on their subscription plan. Take into account if the user continued the subscription after the trial period.

  1. Import the seaborn with the sns alias.
  2. Import the matplotlib.pyplot with the plt alias.
  3. Prepare data for visualization using the .groupby() function:
  • Extract columns 'plan', 'price', 'trial' for grouping
  • Group by column 'plan' and then by 'trial'.
  • Calculate the sum of all prices for each plan.
  • Reset indices.
  1. Create the barplot using the seaborn:
  • Use df as the data argument.
  • Use the 'plan' column for x-axis.
  • Use the 'price' column for y-axis.
  • Use the 'trial' column for hue variable.
  1. Display the plot.

¿Todo estuvo claro?

Sección 3. Capítulo 17
toggle bottom row

Dive Deeper into Visualization

Let's imagine that it is essential for you to sort out the user continued subscription after the trial period. Let's move to the dataset that we use, for example:

Look at the code:

As you can see, we just add the hue parameter, which helps you sort out data by categories. For instance, here, hue = 'trial', the column 'trial' has two categories: True and False.

And here is the output:

barplot

Tarea

Visualize the sum of money you receive from users depending on their subscription plan. Take into account if the user continued the subscription after the trial period.

  1. Import the seaborn with the sns alias.
  2. Import the matplotlib.pyplot with the plt alias.
  3. Prepare data for visualization using the .groupby() function:
  • Extract columns 'plan', 'price', 'trial' for grouping
  • Group by column 'plan' and then by 'trial'.
  • Calculate the sum of all prices for each plan.
  • Reset indices.
  1. Create the barplot using the seaborn:
  • Use df as the data argument.
  • Use the 'plan' column for x-axis.
  • Use the 'price' column for y-axis.
  • Use the 'trial' column for hue variable.
  1. Display the plot.

Tarea

Visualize the sum of money you receive from users depending on their subscription plan. Take into account if the user continued the subscription after the trial period.

  1. Import the seaborn with the sns alias.
  2. Import the matplotlib.pyplot with the plt alias.
  3. Prepare data for visualization using the .groupby() function:
  • Extract columns 'plan', 'price', 'trial' for grouping
  • Group by column 'plan' and then by 'trial'.
  • Calculate the sum of all prices for each plan.
  • Reset indices.
  1. Create the barplot using the seaborn:
  • Use df as the data argument.
  • Use the 'plan' column for x-axis.
  • Use the 'price' column for y-axis.
  • Use the 'trial' column for hue variable.
  1. Display the plot.

¿Todo estuvo claro?

Let's imagine that it is essential for you to sort out the user continued subscription after the trial period. Let's move to the dataset that we use, for example:

Look at the code:

As you can see, we just add the hue parameter, which helps you sort out data by categories. For instance, here, hue = 'trial', the column 'trial' has two categories: True and False.

And here is the output:

barplot

Tarea

Visualize the sum of money you receive from users depending on their subscription plan. Take into account if the user continued the subscription after the trial period.

  1. Import the seaborn with the sns alias.
  2. Import the matplotlib.pyplot with the plt alias.
  3. Prepare data for visualization using the .groupby() function:
  • Extract columns 'plan', 'price', 'trial' for grouping
  • Group by column 'plan' and then by 'trial'.
  • Calculate the sum of all prices for each plan.
  • Reset indices.
  1. Create the barplot using the seaborn:
  • Use df as the data argument.
  • Use the 'plan' column for x-axis.
  • Use the 'price' column for y-axis.
  • Use the 'trial' column for hue variable.
  1. Display the plot.

Sección 3. Capítulo 17
Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
We're sorry to hear that something went wrong. What happened?
some-alt