Skip to content

Instantly share code, notes, and snippets.

@Padhma
Created July 9, 2021 18:49
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 Padhma/036383830323eecbc7e833fdb844086c to your computer and use it in GitHub Desktop.
Save Padhma/036383830323eecbc7e833fdb844086c to your computer and use it in GitHub Desktop.
# picking columns that are more relevant
github_df = github_data_df[['topic','name','user','star','fork','watch','issue','pull_requests','topic_tag','commits','contributers']]
# pass a dictionary with old column names as key and new names as values to rename function
new_names = ['Topic','Repo_Name','User_Name','Star','Fork','Watch','Issues','Pull_Requests','Topic_Tags','Commits','Contributors']
old_names = github_df.columns
github_df = github_df.rename(columns=dict(zip(old_names, new_names)))
# a peek into the dataframe
github_df.head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment