IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Working with Categorical Data in Python

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Convert to categorical and print the frequency table
used_cars["color"] = ____
print(used_cars["color"].value_counts())
Modifica ed esegui il codice