1
목록에서 요소를 찾을 : -파이썬 팬더 내가 팬더 dataframe에서 두 개의 목록을 만들어
목록 1 : 아래와 같이 ... 폴더 내에서 여러 CSV 파일에서 생성 된
import glob as gb
csv_files = gb.glob("csv\\*.csv")
# csv_files = csv_files[0:]
# Create list of the CSV in dataframes
dfList = []
for file in csv_files:
df_csv = pd.read_csv(file, header=None)
dfList.append(df_csv)
# print (dfList)
# Convert each dataframe within the list into individual list
new_dfList = []
for ind_df in dfList:
# Convert the dataframe to a list
new_convert = ind_df.values.tolist()
new_dfList.append(new_convert)
목록 2은 : 아래와 같이 키워드가 포함 된 텍스트 파일에서 작성되었습니다. 리스트 2에서
# Open keywords TEXT file
keywords = pd.read_csv("words.txt", header=None)
# Convert the dataframe to a list
keywords = keywords.values.tolist()
# Move out from inner list
# keywords = list(chain(*keywords))
# print (keywords)
keywords[0]
이 키워드는 목록 1에 각 목록과 비교한다. 어떻게해야합니까?
첫 번째 키워드는 (list1) goto 첫 번째 목록 (list1), 두 번째 키워드 (list2) goto 두 번째 목록 (list1), 세 번째 키워드 (list2) goto 세 번째 목록 (list1) .... 등 검색 결과를 반환하고?