Last active
June 27, 2022 13:16
-
-
Save shaypal5/d19b5e43ed02ed7c718d613e66fb77c9 to your computer and use it in GitHub Desktop.
pdpipe first look
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
>>> df = pd.DataFrame( | |
data=[[4, 165, 'USA'], [2, 180, 'UK'], [2, 170, 'Greece']], | |
index=['Dana', 'Jane', 'Nick'], | |
columns=['Medals', 'Height', 'Born'] | |
) | |
>>> df | |
Medals Height Born | |
Dana 4 165 USA | |
Jane 2 180 UK | |
Nick 2 170 Greece | |
>>> import pdpipe as pdp | |
>>> pipeline = pdp.ColDrop('Medals').Scale('MinMaxScaler').OneHotEncode('Born') | |
>>> pipeline(df) | |
Height Born_UK Born_USA | |
Dana 0.000000 0 1 | |
Jane 1.000000 1 0 | |
Nick 0.333333 0 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment