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 = ____