Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Sorting Data | Explore Dataset
Introduction to Python for Data Analysis

Swipe um das Menü anzuzeigen

book
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:

python

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

python

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.

Aufgabe

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.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 4
Wir sind enttäuscht, dass etwas schief gelaufen ist. Was ist passiert?

Fragen Sie AI

expand
ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

book
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:

python

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

python

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.

Aufgabe

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.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 4
Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
Wir sind enttäuscht, dass etwas schief gelaufen ist. Was ist passiert?
some-alt