search

Is is still considered a BFS algorithm if I modify it A little bit?

Is is still considered a BFS algorithm if I modify it A little bit? Question: So I’m trying to create a program that finds the shortest path from nodeA to nodeB, however, I want to block certain nodes so that it would find another path. I’m not really aiming for an optimal code here I’m …

Total answers: 1

Image search on Marqo is returning random results – how can I fix this?

Image search on Marqo is returning random results – how can I fix this? Question: I configured a marqo index for image search as follows: settings = { "treat_urls_and_pointers_as_images":True, # allows us to find an image file and index it "model":"ViT-L/14" } response = mq.create_index("my-multimodal-index", **settings) I then added some documents: mq.index("my-multimodal-index").add_documents( [ {"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSBgKtI0_GMZMd1Zm4UGRO4E5RL5bN9kBO0FA&usqp=CAU", …

Total answers: 1

list in list, search in an another list

list in list, search in an another list Question: I have a first list, containing string lists and a second list containing strings. I want that when a string from the first list is found in the second, the string from the second is returned and the search resumes at the next string from the …

Total answers: 3

Confirm if duplicated employees are in sequence in pandas dataframe

Confirm if duplicated employees are in sequence in pandas dataframe Question: Imagine I have the following dataframe with repetitive people by firstname and lastname: ID FirstName LastName Country 1 Paulo Cortez Brasil 2 Paulo Cortez Brasil 3 Paulo Cortez Espanha 1 Maria Lurdes Espanha 1 Maria Lurdes Espanha 1 John Page USA 2 Felipe Cardoso …

Total answers: 1

python re unterminated character set at position 0

python re unterminated character set at position 0 Question: CODE: import re inp=input() tup=tuple(map(str,inp.split(‘,’))) i=0 while i<len(tup): x=tup[i] a=re.search("[0-9a-zA-Z$#@",x) if a!="None": break else: i=i+1 if a!="None" and len(tup[i])>=6 and len(tup[i])<=12: print(tup[i]) else: print("invalid") INPUT: [email protected],a F1#,2w3E*,2We3345 ERROR: unterminated character set at position 0 Asked By: hari || Source Answers: The error stems from the invalid …

Total answers: 2

python: search in list of lists of dictionaries

python: search in list of lists of dictionaries Question: I want to iterate over a list of lists of dictionaries: data = [ {‘name’: ‘sravan’}, {‘name’: ‘bobby’}, {‘name’: ‘ojsawi’, ‘number’: ‘123’}, {‘name’: ‘rohith’, ‘number’: ‘456’}, {‘name’: ‘gnanesh’, ‘number’: ‘123’} ] Furthermore I want to check each entry if there is a key number where the …

Total answers: 2

most efficient way to search for a word in multiple files

most efficient way to search for a word in multiple files Question: For my master thesis i downloaded a ton of finance related files. my objective is to find a specific set of words ("chapter 11") to flag all companies that have gone through the debt restructuring process. The problem is that i have more …

Total answers: 3

Dictionary Search for adjacent items with same features

Dictionary Search for adjacent items with same features Question: I have a dictionary encoding x,y,z and color information for a finite Lego assembly like this "p_xx_yy": [‘color’, z]: "myDict" : { ‘p_00_00’:[ ‘y’, 1 ], ‘p_00_01’:[ ‘y’, 1 ], ‘p_00_02’:[ ‘g’, 0 ], ‘p_00_03’:[ ‘w’, 1 ], ‘p_00_04’:[ ‘g’, 0 ], ‘p_00_05’:[ ‘o’, 1 ], …

Total answers: 1