Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Created August 15, 2020 05:41
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 aniruddha27/bf71ad077f01bd8a4d9169abf4122d88 to your computer and use it in GitHub Desktop.
Save aniruddha27/bf71ad077f01bd8a4d9169abf4122d88 to your computer and use it in GitHub Desktop.
# Unique hashtag counts
table = df_tags.pivot_table(index="Hashtags",values='Tweet_Id',aggfunc=len)
# Convert pivot table to dataframe
df_pivot = pd.DataFrame(table.to_records())
df_pivot.head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment