I am creating a script that searches for a file based on a keyword, my output should be the whole observation, rather than just the matched text, but I'm finding .group doesn't work on this.
import re
import os
pers_info = pd.read_csv(r".....StateWorkforceMailingList_2-7-19a.csv",encoding='utf-8')
Pers_info['State'] = Texas, Florida etc...
files=os.listdir(r"....\State Files")
Files = list of WORKFORCE_2017_ALABAMA_FILE.xlsx,...,n
matches=re.findall(pers_info.State[4], files.replace("_", " "),re.I)
print(match)
My intended output is WORKFORCE_2017_ALABAMA_FILE.xlsx Instead I get 'Alabama'
Should I try a boolean mask ?