numpy
-
[Python] numpy setdiff1d(차집합)을 이용한 2개의 텍스트 파일 비교Python/Python For Analytics 2019. 10. 30. 12:20
numpy.setdiff1d(array1, array2) : 2개의 array의 차집합 A_file.txt B_file.txt Tomatoes are red Bananas are yellow Strawberries are red Oranges are orange Blackberries are black Tomatoes are red Bananas are yellow Blackberries are black import pandas as pd import numpy as np df_A = pd.read_csv('A_file.txt', names=['data_A']) df_B = pd.read_csv('B_file.txt', names=['data_B']) list_A = np.array(df_A['data..