Skip to content

Instantly share code, notes, and snippets.

@ImadDabbura
Created August 3, 2018 20:26
Show Gist options
  • Select an option

  • Save ImadDabbura/5a73841693731c857b0aa2349d6b1616 to your computer and use it in GitHub Desktop.

Select an option

Save ImadDabbura/5a73841693731c857b0aa2349d6b1616 to your computer and use it in GitHub Desktop.
# Rename sales feature into department
df = df.rename(columns={"sales": "department"})
# Map salary into integers
salary_map = {"low": 0, "medium": 1, "high": 2}
df["salary"] = df["salary"].map(salary_map)
# Create dummy variables for department feature
df = pd.get_dummies(df, columns=["department"], drop_first=True)
@ImadDabbura

Copy link
Copy Markdown
Author

Added prep_employee_data.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment