Зміст курсу
Introduction to Python for Data Analysis
Introduction to Python for Data Analysis
Sorting 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:
If we want to perform descending, we have to turn off the ascending
parameter.
If the parameter inplace is set to
True
(inplace = True
), it will perform the operation inplace. Modify the original DataFrame itself. The return type isNone
.
Swipe to show code editor
Now we are going to practice sorting. We will sort 2 different DataFrame columns using ascending and descending sorting.
- Import the
pandas
using thepd
alias. - Perform an ascending sorting by the
'price'
column. - Perform a descending sorting by the
'user_id'
column.
Дякуємо за ваш відгук!
Sorting 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:
If we want to perform descending, we have to turn off the ascending
parameter.
If the parameter inplace is set to
True
(inplace = True
), it will perform the operation inplace. Modify the original DataFrame itself. The return type isNone
.
Swipe to show code editor
Now we are going to practice sorting. We will sort 2 different DataFrame columns using ascending and descending sorting.
- Import the
pandas
using thepd
alias. - Perform an ascending sorting by the
'price'
column. - Perform a descending sorting by the
'user_id'
column.
Дякуємо за ваш відгук!
Sorting 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:
If we want to perform descending, we have to turn off the ascending
parameter.
If the parameter inplace is set to
True
(inplace = True
), it will perform the operation inplace. Modify the original DataFrame itself. The return type isNone
.
Swipe to show code editor
Now we are going to practice sorting. We will sort 2 different DataFrame columns using ascending and descending sorting.
- Import the
pandas
using thepd
alias. - Perform an ascending sorting by the
'price'
column. - Perform a descending sorting by the
'user_id'
column.
Дякуємо за ваш відгук!
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:
If we want to perform descending, we have to turn off the ascending
parameter.
If the parameter inplace is set to
True
(inplace = True
), it will perform the operation inplace. Modify the original DataFrame itself. The return type isNone
.
Swipe to show code editor
Now we are going to practice sorting. We will sort 2 different DataFrame columns using ascending and descending sorting.
- Import the
pandas
using thepd
alias. - Perform an ascending sorting by the
'price'
column. - Perform a descending sorting by the
'user_id'
column.