Skip to content

Instantly share code, notes, and snippets.

@risenW
Created August 17, 2020 13:27
Show Gist options
  • Save risenW/2e9b737fd62c0d0e003bbf8793a7ce78 to your computer and use it in GitHub Desktop.
Save risenW/2e9b737fd62c0d0e003bbf8793a7ce78 to your computer and use it in GitHub Desktop.
//label Encode Name feature
let encoder = new dfd.LabelEncoder()
let cols = ["Sex", "Name"]
cols.forEach(col => {
encoder.fit(df[col])
enc_val = encoder.transform(df[col])
df.addColumn({ column: col, value: enc_val })
})
df.head().print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment