Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Sorting Data | Explore Dataset
Introduction to Python for Data Analysis

bookSorting Data

We need sorting for ease of work.

We can sort our data in 2 ways: ascending sorting and descending sorting.

To perform the ascending sorting, use the following code:

DataFrame.sort_values(by = 'column_name', inplace = True)

If we want to perform descending, we have to turn off the ascending parameter.

DataFrame.sort_values(by = 'column_name', inplace = True, ascending = False)

If the parameter inplace is set to True (inplace = True), it will perform the operation inplace. Modify the original DataFrame itself. The return type is None.

Завдання

Swipe to start coding

Now we are going to practice sorting. We will sort 2 different DataFrame columns using ascending and descending sorting.

  1. Import the pandas using the pd alias.
  2. Perform an ascending sorting by the 'price' column.
  3. Perform a descending sorting by the 'user_id' column.

Рішення

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

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 4
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Suggested prompts:

Сумаризуйте цей розділ

Пояснити код у file

Пояснити, чому file не вирішує завдання

close

bookSorting Data

Свайпніть щоб показати меню

We need sorting for ease of work.

We can sort our data in 2 ways: ascending sorting and descending sorting.

To perform the ascending sorting, use the following code:

DataFrame.sort_values(by = 'column_name', inplace = True)

If we want to perform descending, we have to turn off the ascending parameter.

DataFrame.sort_values(by = 'column_name', inplace = True, ascending = False)

If the parameter inplace is set to True (inplace = True), it will perform the operation inplace. Modify the original DataFrame itself. The return type is None.

Завдання

Swipe to start coding

Now we are going to practice sorting. We will sort 2 different DataFrame columns using ascending and descending sorting.

  1. Import the pandas using the pd alias.
  2. Perform an ascending sorting by the 'price' column.
  3. Perform a descending sorting by the 'user_id' column.

Рішення

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

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 4
single

single

some-alt