MulaiMulai sekarang secara gratis

Load a CSV into a DataFrame

As a data analyst you've been tasked with creating a market analysis of available electric vehicles. Your first step is to import the dataset.

For these exercises you have a CSV with details of electric vehicles, including the vehicle brand and model, performance characteristics, such as its range, and finally, the price of the vehicle. You will be analyzing this dataset to understand how the vehicles compare to each other.

Polars has already been imported as pl for you - this will be the case for every exercise.

Latihan ini adalah bagian dari kursus

Introduction to Polars

Lihat Kursus

Petunjuk latihan

  • Load the "electric_vehicles.csv" into a Polars DataFrame called ev_df.
  • Print the first three rows of the DataFrame using an appropriate method.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Load the CSV into a DataFrame
ev_df = ____("electric_vehicles.csv")

# Print the first three rows
print(ev_df.____)
Edit dan Jalankan Kode