Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Countplot | Nice to Meet you, seaborn!
First Dive into seaborn Visualization
course content

Зміст курсу

First Dive into seaborn Visualization

First Dive into seaborn Visualization

1. Nice to Meet you, seaborn!
2. More and More Plots
3. Plot Customization

Countplot

A countplot is a plot that takes a categorical list and returns columns that represent the number of list entries for each category.

An example of a countplot:

To initialize a countplot, we need to input at least 1 parameter: x (the column in which values will be counted).

Note

We may also use y instead of x to change the orientation of the plot.

As the seaborn is based on the matplotlib, we may use a special matplotlib.pyplot library and its function plt.show() to show the plot:

Look at the code below!

12345678910111213
# Importing the Seaborn import seaborn as sns # Importing the matplotlib.pyplot import matplotlib.pyplot as plt # Data list data_list = ['apple', 'fish', 'milk', 'milk', 'apple', 'apple', 'milk', 'fish', 'fish'] # Creating the countplot sns.countplot(x = data_list) # Showing the plot plt.show()
copy

Let's solve this problem!

Завдання

  1. Import the seaborn library with the sns alias.
  2. Import the matplotlib.pyplot library with the plt alias.
  3. Initialize the x-oriented countplot for guests_list.
  4. Show the plot.

Завдання

  1. Import the seaborn library with the sns alias.
  2. Import the matplotlib.pyplot library with the plt alias.
  3. Initialize the x-oriented countplot for guests_list.
  4. Show the plot.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 1. Розділ 3
toggle bottom row

Countplot

A countplot is a plot that takes a categorical list and returns columns that represent the number of list entries for each category.

An example of a countplot:

To initialize a countplot, we need to input at least 1 parameter: x (the column in which values will be counted).

Note

We may also use y instead of x to change the orientation of the plot.

As the seaborn is based on the matplotlib, we may use a special matplotlib.pyplot library and its function plt.show() to show the plot:

Look at the code below!

12345678910111213
# Importing the Seaborn import seaborn as sns # Importing the matplotlib.pyplot import matplotlib.pyplot as plt # Data list data_list = ['apple', 'fish', 'milk', 'milk', 'apple', 'apple', 'milk', 'fish', 'fish'] # Creating the countplot sns.countplot(x = data_list) # Showing the plot plt.show()
copy

Let's solve this problem!

Завдання

  1. Import the seaborn library with the sns alias.
  2. Import the matplotlib.pyplot library with the plt alias.
  3. Initialize the x-oriented countplot for guests_list.
  4. Show the plot.

Завдання

  1. Import the seaborn library with the sns alias.
  2. Import the matplotlib.pyplot library with the plt alias.
  3. Initialize the x-oriented countplot for guests_list.
  4. Show the plot.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 1. Розділ 3
toggle bottom row

Countplot

A countplot is a plot that takes a categorical list and returns columns that represent the number of list entries for each category.

An example of a countplot:

To initialize a countplot, we need to input at least 1 parameter: x (the column in which values will be counted).

Note

We may also use y instead of x to change the orientation of the plot.

As the seaborn is based on the matplotlib, we may use a special matplotlib.pyplot library and its function plt.show() to show the plot:

Look at the code below!

12345678910111213
# Importing the Seaborn import seaborn as sns # Importing the matplotlib.pyplot import matplotlib.pyplot as plt # Data list data_list = ['apple', 'fish', 'milk', 'milk', 'apple', 'apple', 'milk', 'fish', 'fish'] # Creating the countplot sns.countplot(x = data_list) # Showing the plot plt.show()
copy

Let's solve this problem!

Завдання

  1. Import the seaborn library with the sns alias.
  2. Import the matplotlib.pyplot library with the plt alias.
  3. Initialize the x-oriented countplot for guests_list.
  4. Show the plot.

Завдання

  1. Import the seaborn library with the sns alias.
  2. Import the matplotlib.pyplot library with the plt alias.
  3. Initialize the x-oriented countplot for guests_list.
  4. Show the plot.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

A countplot is a plot that takes a categorical list and returns columns that represent the number of list entries for each category.

An example of a countplot:

To initialize a countplot, we need to input at least 1 parameter: x (the column in which values will be counted).

Note

We may also use y instead of x to change the orientation of the plot.

As the seaborn is based on the matplotlib, we may use a special matplotlib.pyplot library and its function plt.show() to show the plot:

Look at the code below!

12345678910111213
# Importing the Seaborn import seaborn as sns # Importing the matplotlib.pyplot import matplotlib.pyplot as plt # Data list data_list = ['apple', 'fish', 'milk', 'milk', 'apple', 'apple', 'milk', 'fish', 'fish'] # Creating the countplot sns.countplot(x = data_list) # Showing the plot plt.show()
copy

Let's solve this problem!

Завдання

  1. Import the seaborn library with the sns alias.
  2. Import the matplotlib.pyplot library with the plt alias.
  3. Initialize the x-oriented countplot for guests_list.
  4. Show the plot.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 1. Розділ 3
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt