IniziaInizia gratis

Destination

Now you'll encode the dest column just like you did in the previous exercise.

Questo esercizio fa parte del corso

Foundations of PySpark

Visualizza il corso

Istruzioni dell'esercizio

  • Create a StringIndexer called dest_indexer by calling StringIndexer() with inputCol="dest" and outputCol="dest_index".
  • Create a OneHotEncoder called dest_encoder by calling OneHotEncoder() with inputCol="dest_index" and outputCol="dest_fact".

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Create a StringIndexer
dest_indexer = ____

# Create a OneHotEncoder
dest_encoder = ____
Modifica ed esegui il codice