Get startedGet started for free

Transforming Data

You are asked to provide an analysis of the range of the electric vehicles for a client in the United States. However, the range data is given in kilometers and you are asked to convert this to range in miles.

This exercise is part of the course

Introduction to Polars

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# There are 1.609 kilometers in a mile
MILES_TO_KILOMETERS = 1.609

# Select the columns with range converted to miles
range_df = ev_df.select(____, ____, ____ / MILES_TO_KILOMETERS)

print(range_df)
Edit and Run Code