Created
November 3, 2019 19:50
-
-
Save lakshay-arora/38e12652deb5d98c371ce127ae720968 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create object and specify input and output column | |
OHE = OneHotEncoderEstimator(inputCols=['Batsman_Index', 'Bowler_Index'],outputCols=['Batsman_OHE', 'Bowler_OHE']) | |
# transform the data | |
my_data = OHE.fit(my_data).transform(my_data) | |
# view and transform the data | |
my_data.select('Batsman_Name', 'Batsman_Index', 'Batsman_OHE', 'Bowler_Name', 'Bowler_Index', 'Bowler_OHE').show(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment