string-matching

Creating a dictionary in Naive algorithm for Pattern Searching

Creating a dictionary in Naive algorithm for Pattern Searching Question: I’m trying to find the number of times a certain string pattern is found inside a sequence of characters; for the bioinformatics lovers, it’s actually finding the number of times a certain motif occurs along the genome. For this purpose I’ve found the following Python …

Total answers: 1

Python String Matching Using Loops and Iterations and Score Calculation using two dataframes

Python String Matching Using Loops and Iterations and Score Calculation using two dataframes Question: df1 Place Location Delhi,Punjab,Jaipur Delhi,Punjab,Noida,Lucknow Delhi,Punjab,Jaipur Delhi,Bhopal,Jaipur,Rajkot Delhi,Punjab,Kerala Delhi,Jaipur,Madras df2 Target1 Target2 Strength Jaipur Rajkot 0.94 Jaipur Punjab 0.84 Jaipur Noida 0.62 Jaipur Jodhpur 0.59 Punjab Amritsar 0.97 Punjab Delhi 0.85 Punjab Bhopal 0.91 Punjab Jodhpur 0.75 Kerala Varkala 0.85 Kerala …

Total answers: 1

match specific pattern with few substitution

match specific pattern with few substitution Question: HI I am working on antibodies where I have to find a specific pattern for it’s antigen specificity using python. I am puzzling over to find a match pattern with predefined numbers of substitution. I tried regex (re.findall/re.search) with possible permutation/combination but this couldn’t solve my problem. Also, …

Total answers: 1

Python str.match regex works in main but not within another function

Python str.match regex works in main but not within another function Question: I have files with 6 character codes of the form AANNAA where A=letter and N=number. I want to flag the rows that fit (assign 0) or don’t fit (assign 1) that pattern. The following code works in that it identifies codes that don’t …

Total answers: 1

How do I approximate search multiple terms in a string in JS?

How do I approximate search multiple terms in a string in JS? Question: I have a string S and a list of strings allItems, allItems contains strings that may have common "sub-words" but one element is never an extension of another: //good, they both contain Fuzzy but Fuzzy isn’t in allItems const allItems = "FuzzyBunny", …

Total answers: 1

How to store matched part of regex in python?

How to store matched part of regex in python? Question: The string is xa0n xxxxxxnBirchgrove 101,Durga Saffron Square,nKariyammana Agrahara, Bellandur, [email protected]’ and it is in a list called shipto and it is at index 0 of this list. the regex I am using is shipto_re=re.compile(r"\n xxxxxx\n(.*)(.*?) xxxxxx") The part of the string that I want …

Total answers: 1

Remove ends of string entries in pandas DataFrame column

Remove ends of string entries in pandas DataFrame column Question: I have a pandas Dataframe with one column a list of files import pandas as pd df = pd.read_csv(‘fname.csv’) df.head() filename A B C fn1.txt 2 4 5 fn2.txt 1 2 1 fn3.txt …. …. I would like to delete the file extension .txt from …

Total answers: 6