BaşlayınÜcretsiz Başlayın

Renaming and dropping columns

When you present results to your colleagues you see that they are confused about what some data represents and overwhelmed by the amount of data presented. You want to rename some columns to ensure your colleagues understand what each column refers to, while dropping some columns that are not relevant.

Bu egzersiz

Introduction to Polars

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Update the column names with the column name mappings in the renamed_columns dict.
  • Drop the "top_speed" and "charge_rate" columns from the DataFrame.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Dict with column renamings
renamed_columns = {"accel":"acceleration_secs","range":"range_km"}

# Rename and drop the columns
modified_ev_df = (
    ev_df.____.____
)

print(modified_ev_df)
Kodu Düzenle ve Çalıştır