BFS, DFS 정의 _ 순회 탐색 알고리즘
BFS(breadth-first search) 너비우선탐색 BFS는 큐, 딕셔너리, 리스트, 내장함수 개념을 활용 bfs_graph = { # 그래프를 인접리스트로 표현 1: [2,3,4], 2: [1,5,6], 3: [1,6], 4: [1], 5: [6,7], 6: [5], 7: [6], } def bfs_queue(start_node): bfs_list = [start_node] queue = [start_node] while queue:#외부반복문 node = queue.pop(0) for i in bfs_graph[node]: #내부반복문 if i not in bfs_list: bfs_list.append(i) queue.append(i) return bfs_list bfs_queue(2) # 1..
2021. 5. 25.
데이터 엔지니어
[코드내용] (1) 데이터셋 불러오기 (pd.read_csv , df.shape , dataframe column 지정) (2) EDA (Uni - Non Graphic , Uni - Graphic , Multi Uni - Non Graphic , Multi Uni - Graphic) (3) EDA이후 (데이터 전처리) (4) Feature engineering (5) String & Type case (df.apply) (6) Data Manipulation (concat , merge , isin , group by) (7) Tidy data (melt , pivot_table , wide -> tidy , tidy -> wide) https://github.com/khalidpark/data_eng..
2021. 5. 19.