compare

Comparing two Dataframes and creating a third one where certain contions are met

Comparing two Dataframes and creating a third one where certain contions are met Question: I am trying to compare two different dataframe that have the same column names and indexes(not numerical) and I need to obtain a third df with the biggest value for the row with the same column name. Example df1= | | …

Total answers: 1

Compare two Dataframe columns and retrive the mismatched columns in a new column

Compare two Dataframe columns and retrive the mismatched columns in a new column Question: I am trying to compare two dataframes and create one column in the first dataframe says that mismatched columns. attaching the Dataframe images and expected output images below. Could I get some help here enter image description here attaching the expected …

Total answers: 2

check if element is in anywhere the list

check if element is in anywhere the list Question: I have two lists: expected = ["apple", "banana", "pear"] actual = ["banana_yellow", "apple", "pear_green"] I’m trying to assert that expected = actual. Even though the color is added at the end to some elements, it should still return true. Things I tried: for i in expected: …

Total answers: 5

comparing two sets and finding equation about them python

comparing two sets and finding equation about them python Question: I have two sets list1 = {1,2,3,4,5,6,7,8,9,10} list2 = {10,20,30,40,50,60,70,80,90,100} I want python to see if there is a relation between each number and if the relation is the same for each number(for this example it would be the same for each number and the …

Total answers: 1

compare two list and set zero for not exist value

compare two list and set zero for not exist value Question: I want to compare lst2 with lst and set zero for value who is not exist lst = [‘IDP’,’Remote.CMD.Shell’,’log4j’] lst2 = [‘IDP’] I want output like this in for example loop { IDP:1, Remote.CMD.Shell:0, log4j:0 } { IDP:0, Remote.CMD.Shell:0, log4j:0 } { IDP:0, Remote.CMD.Shell:0, …

Total answers: 2

python question about loops comparing string to string

python question about loops comparing string to string Question: I am trying to emulate a circumstance where i send information and only get a true or false as a return. So i can check each character and if it is true, that means that character is in the string. I would know there would be …

Total answers: 1