Created
October 26, 2021 16:18
-
-
Save vinimonteiro/88c17beac6509e3957ae23599335bb45 to your computer and use it in GitHub Desktop.
One hot encoding with get_dummies
This file contains hidden or 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
import pandas as pd | |
df = pd.read_table('https://data.princeton.edu/wws509/datasets/salary.dat',delim_whitespace=True) | |
dummy = pd.get_dummies(df['sx']) | |
print(dummy.head()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment