search

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: ABd1234@1,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

How to search through an array and remove items that don't match a certain critera

How to search through an array and remove items that don't match a certain critera Question: I’m new to python and currently trying to complete an assignment. I have tried searching for an answer in other places but I have found my specific issues anywhere. Basically the assignment is to create an ATM transaction log …

Total answers: 1

Checking the contents of the tuple in Python

Checking the contents of the tuple in Python Question: How would I be able to write a function that checks a tuple if it contains at least 2 H elements in the list. So for the example below there are 2 tuples in A that contain 2 H elements {(‘H’, ‘H’, ‘H’, ‘T’) and (‘T’, …

Total answers: 2

Python Search function in .csv using lists

Python Search function in .csv using lists Question: I have a .csv file divided in four different columns, and I would write a search function in python that gives to me the print of a particular line of the document, but to do that I made some lists to get a thickest search…that’s because if …

Total answers: 2