Home > other >  The pit of python3.7 string to find
The pit of python3.7 string to find

Time:11-18

I used the pandas reading excel, need a specific string from certain fields (in Chinese), from the Internet to find a Chinese string search is not difficult, use STR. Find (" China red "), "China red" in STR, or re. The search (STR, 'Chinese red'), these three methods all tried, no one work,
I read excel statement is: df=pd read_excel (fileName, encoding='GBK'), or df=pd read_excel (fileName), and the results are the same, is to can't find my character, but if the code is as follows: s1='Chinese red red is such, s2=' Chinese red ', use the above code to find, there is no problem, that problem in reading excel has a problem, where is the problem? Make a morning, solve such a simple question, ask for help!!!!!!!!!!!!!!!!!!!!

CodePudding user response:

Reference:

CodePudding user response:

No code, didn't also the way to try

CodePudding user response:

Should be data types in the pan, I have not used the pandas, you can have a look at what is read excel data data classes, you string search methods mentioned above are search string in the string, if the target is not a string type, it must be an error,

CodePudding user response:

Can't use the STR () reads the data into a string type may have a problem?
  • Related