LoslegenKostenlos loslegen

Sorting the EV data

Your clients frequently ask which EVs offer the longest driving range between charges — a critical factor for those with longer commutes or who travel frequently. You want to sort the electric vehicles in ev_df in terms of how far they can go on a single charge.

Diese Übung ist Teil des Kurses

Introduction to Polars

Kurs anzeigen

Anleitung zur Übung

  • Sort the DataFrame by the "range" column.
  • Ensure the results are ordered with the longest ranges first.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Sort with longest range first
sorted_ev_df = ev_df.____

print(sorted_ev_df)
Code bearbeiten und ausführen