Skip to content

Instantly share code, notes, and snippets.

@tomasonjo
Created June 28, 2022 09:46
Show Gist options
  • Save tomasonjo/b084db3ea8a2d09691dd80e7296503c4 to your computer and use it in GitHub Desktop.
Save tomasonjo/b084db3ea8a2d09691dd80e7296503c4 to your computer and use it in GitHub Desktop.
merged_df = pivot_features_df.merge(kmeans_df, on="nodeId")
merged_df.drop("nodeId", axis=1).groupby("communityId").size().to_frame(
"communitySize"
).reset_index()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment