Skip to content

Instantly share code, notes, and snippets.

@goungoun
Last active June 21, 2019 05:19
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 goungoun/5739fc5e81c5df118f94d3528d6a7ccc to your computer and use it in GitHub Desktop.
Save goungoun/5739fc5e81c5df118f94d3528d6a7ccc to your computer and use it in GitHub Desktop.
vertex에 없는 edge 빼기
import pandas as pd
vtx=pd.read_csv("vtx.tsv", sep=" ")
edge=pd.read_csv("edge.tsv", sep=" ")
edge = edge[edge[':START_ID'].isin(vtx["id:ID"])]
edge = edge[edge[':END_ID'].isin(vtx["id:ID"])]
edge.to_csv("edge2.tsv", sep=" ", index=False, header = True)
# https://pandas.pydata.org/Pandas_Cheat_Sheet.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment