Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created December 15, 2020 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/912655dd56320fabea0060500d2e1233 to your computer and use it in GitHub Desktop.
Save amankharwal/912655dd56320fabea0060500d2e1233 to your computer and use it in GitHub Desktop.
df = df.rename(columns={'age': 'age',
' workclass': 'workclass',
' fnlwgt': 'final_weight',
' education': 'education',
' education-num': 'education_num',
' marital-status': 'marital_status',
' occupation': 'occupation',
' relationship': 'relationship',
' race': 'race',
' sex': 'sex',
' capital-gain': 'capital_gain',
' capital-loss': 'capital_loss',
' hours-per-week': 'hrs_per_week',
' native-country': 'native_country',
' income': 'income'
})
df.columns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment