I was thinking about filtering the dataframe columns using the wordlist. That way, I wouldn't have to create a tuple of all values from the excel. I got 1 filter, the department name down using the below code:
[inline]kvadsun,"te6659,3416652","w/h:1,block b,alqou-3",email:,"p.o282062,dub",[email protected],keep_trct·__223/dustrialds_buildhardware,inv_validCode,cm no.,: c23/d00134,…....,/////////alph,: 01/09/2023,vareg:0575413,sm id,: s-12,vareg,003455795___,nitpr
[/inline]
The 10th value has special character " : " in the machine ID. The current filtered df reads below:
erpNum mch_id depName
488 HO5106 259 Keep_Trct
530 HO5129 267 Keep_Trct
770 HO5290 391 Keep_Trct
975 HO5431 C23/D00134 Keep_Trct
977 HO5432 I23/D00448 Keep_Trct
Sorry I'm not sure how to add a table, but in the above filtered table, the value in mch_id @ 975 doesn't match because of the special characters. So, I wanted to use the above mch_id values as regex pattern to match against the csv. Ideally, I'd like to filter both using the regex, but the above code was a T&E to see if filtering worked. But the next filter is difficult.
for line in res: x, y = line wordlist.append(y[0].lower()) df = dframe[dframe['depName'].str.lower().isin (wordlist)]What I have now are again the [wordlist] and a filtered df. The next filter, is to match the machine ID to that in CVS. However, in the CSV:
[inline]kvadsun,"te6659,3416652","w/h:1,block b,alqou-3",email:,"p.o282062,dub",[email protected],keep_trct·__223/dustrialds_buildhardware,inv_validCode,cm no.,: c23/d00134,…....,/////////alph,: 01/09/2023,vareg:0575413,sm id,: s-12,vareg,003455795___,nitpr
[/inline]
The 10th value has special character " : " in the machine ID. The current filtered df reads below:
erpNum mch_id depName
488 HO5106 259 Keep_Trct
530 HO5129 267 Keep_Trct
770 HO5290 391 Keep_Trct
975 HO5431 C23/D00134 Keep_Trct
977 HO5432 I23/D00448 Keep_Trct
Sorry I'm not sure how to add a table, but in the above filtered table, the value in mch_id @ 975 doesn't match because of the special characters. So, I wanted to use the above mch_id values as regex pattern to match against the csv. Ideally, I'd like to filter both using the regex, but the above code was a T&E to see if filtering worked. But the next filter is difficult.