शुरू करेंमुफ़्त में शुरू करें

Destination

अब आप dest कॉलम को पिछले अभ्यास की तरह ही एन्कोड करेंगे।

यह अभ्यास पाठ्यक्रम का हिस्सा है

PySpark की नींव

पाठ्यक्रम देखें

अभ्यास निर्देश

  • inputCol="dest" और outputCol="dest_index" के साथ StringIndexer() कॉल करके dest_indexer नाम का StringIndexer बनाएँ।
  • inputCol="dest_index" और outputCol="dest_fact" के साथ OneHotEncoder() कॉल करके dest_encoder नाम का OneHotEncoder बनाएँ।

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

# Create a StringIndexer
dest_indexer = ____

# Create a OneHotEncoder
dest_encoder = ____
कोड संपादित करें और चलाएँ