LoslegenKostenlos loslegen

Create a label encoding and map

A used car company believes that they can predict a car's sales price reasonably well using their used_cars dataset. One of the variables they want to use, "color", needs to be converted to codes. The company believes that a car's color will be important when predicting sales price.

Diese Übung ist Teil des Kurses

Working with Categorical Data in Python

Kurs anzeigen

Interaktive Übung

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

# Convert to categorical and print the frequency table
used_cars["color"] = ____
print(used_cars["color"].value_counts())
Code bearbeiten und ausführen