본문 바로가기

728x90
반응형

Papers/Implement

(3)
dblp v10 json 파일 읽는 방법 with open("C:/Users/ohy36/Desktop/python workspace/논문/dblp/dblp-ref/dblp_ref_3.json", "r", newline = "\n") as f: lines = [line.strip() for line in f.readlines()] for i,line in enumerate(lines): print(line) if i == 2: break # 기존 실패한 방법 import json with open("파일위치", "r") as f: lines = json.load(f) for line in lines: print(line) 오류코드 json.decoder.jsondecodeerror: extra data: line 2 column 1 (char 1..
[python] node(vertex) topology index 만들기 앞서 포스팅한 Snap 데이터를 이용하여 가중치가 존재하는 라벨 그래프 데이터를 만들어 보았다. ssanggo.tistory.com/52 [python] 그래프 데이터 만들기(using. Snap) 파이썬을 이용하여 weight Labeled Graph Data를 만들어 보았다. 먼저, Graph data는 Snap Data를 사용하였다. Snap Data는 id_1, id_2 로 이루어진 데이터 이고, 이 데이터를 가공하여 weight Labeled Graph Da.. ssanggo.tistory.com 이번에는 만들어진 데이터에서 NTF index 를 만들어 볼 예정이다. NTF index는 아래 링크의 논문에서 사용한 Node Topology feature index 이며, 다음과 같은 index ..
[python] 그래프 데이터 만들기(using. Snap) 파이썬을 이용하여 weight Labeled Graph Data를 만들어 보았다. 먼저, Graph data는 Snap Data를 사용하였다. Snap Data는 id_1, id_2 로 이루어진 데이터 이고, 이 데이터를 가공하여 weight Labeled Graph Data 를 만들 것이다. Snap data를 받을 수 있는 곳은 게시물 하단에 Link를 걸어둘테니, 필요하다면 해당 Link에 들어가서 Download 받기를 바란다. 데이터 가공 순서로는 snap data를 읽고, Weight와 그래프 Label을 임의적으로 생성을 하고, 새로운 File에 저장하는 형태로 진행하였다. [ Source Code ] """ 1. make a graph data file """ import random ra..

728x90
반응형