sorting
-
pandas DataFrame join merge concat 연산 속도 비교데이터분석 2021. 7. 30. 01:00
0. Intro pandas DataFrame을 join해야하는 경우는 매우매우 빈번하다. 그래서 join 방법들을 모두 정리해볼까 한다. # 준비한 데이터는 다음과 같음 print(raw.shape) # (9142946, 21) print(address.shape) # (1396049, 11) 1. 단일 column 기준 join 한 개의 column을 기준으로 join하는 방법들과 성능은 다음과 같음 결론: join 할 때 index를 바로 지정하지 말자;; # pd.merge 사용 %%timeit merge_on = pd.merge(raw, address, how='left', left_on='CI', right_on='CI') # 42.1 s ± 178 ms per loop (mean ± std...