Good day all
so I was trying to filter file2 based on file1, where file1 is a subset from file2. But file2 has a description column that I need to be able to analyse the data in file1. What I'm trying to do is to filter file2, and get only the titles that are in file1 with their description. I tried this, but I'm not quite sure if it is totally right, plus it is working but I don't get any file saved on my computer.
import re
import mmap
from pandas import DataFrame
output = []
with open('file2.csv', 'r') as f2:
mm = mmap.mmap(f2.fileno(), 0, access=mmap.ACCESS_READ)
for line in open('file1.csv', 'r'):
Title = bytes("")
nameMatch = re.search(Title, mm)
if nameMatch:
# output.append(str(""))
fulltypes = [ 'O*NET-SOC Code', 'Title' , 'Discription' ]
final = DataFrame(columns=fulltypes)
final.to_csv(output.append(str("")))
mm.close()
Any idea?