I use pandas Read a EXCEL( by xlsx Format , The EXCEL It's from txt Imported ), And USES the re.findall Regularization wants to get the data , But you always get a null value [].
wdi=pd.read_excel(r"wdisp.xlsx",engine="openpyxl")
wyj_c=re.findall(r"1/\d+",str(wdi))
print(' result :',wyj_c)
result : []
I tried to EXCEL Manually enter... In '1/1000' as well as ' What I want 1/1000', You can get this after running '1/1000', It shows that the code can obtain character type or numeric data , But the values with the same characteristics in the original data can not be extracted .
It is hoped that the extracted features are ‘1/’ The data of
df Not directly supported re, Suggest using
df.str.contains() This lookup contains characters df.str.findall() This value finds the corresponding character