1. เรียนรู้
  2. /
  3. Courses
  4. /
  5. Introduction to Polars

Connected

Exercises

Transforming Multiple Columns

You want to transform your data from kilometers to miles for an American client. You want do it in an efficient way that applies the same transformation to multiple columns.

คำแนะนำ 1 / 2

undefined XP
  • 1
    • Convert the "top_speed" and "range" columns from kilometers to miles using pl.col() using the provided scaling factor.
  • 2
    • Get the length of all string columns by passing a dtype to pl.col() and using .str.len_chars() expression.