Check to see if two lists have the same value at the same index, if so return the index. If not return -1

Advertisements So basically I am trying to compare two lists to see if they hold the same value at the same index at any point. If they do I return the index, if they do not, I return -1. ` Dlist = [17,13,10,6,2] Ilist = [5,9,10,15,18] def seqsearch(DS,IS): for i in range(len(DS)-1): found = False… Read More Check to see if two lists have the same value at the same index, if so return the index. If not return -1

How to compare column in different dataframes for fragment of characters in python

Advertisements I have two dataframes of different size but common columns, with ID numbers as key column. I want to compare the column "names" in both dataframes. But sometimes the "names" does not match because there are upper cases or there are additional uncommon words. Is there a way to "match" the column with something… Read More How to compare column in different dataframes for fragment of characters in python

What happens when you do a comparison "date <= datetime" in SQL-server?

Advertisements What happens when you do a comparison "date <= datetime" in SQL-server? Are they both cast to date or are they both cast to datetime in order to do the comparison? >Solution : datetime has higher precedence than date so the date will be cast to datetime. This is documented here. Or you can… Read More What happens when you do a comparison "date <= datetime" in SQL-server?

Why does str.lower() modify modify string comp

Advertisements I have the following python code snipped and have been getting insane as i don’t understand why I’m getting these different results. Can anyone elaborate? test = "GTX1050Ti 4GB" print(test) if "gtx" and "560" and "ti" in test: print("GTX 560 Ti") else: print("nope") print(test.lower()) if "gtx" and "560" and "ti" in test.lower(): print("GTX 560… Read More Why does str.lower() modify modify string comp

I have this error System.ServiceModel.Security.MessageSecurityException

Advertisements For what I read and understood, this happens when I’m not sending the authentication. But I tried to send it in two ways: string userN = "username"; string _pasw = "password"; BasicHttpBinding binding = new BasicHttpBinding(); Endpoint wsdl = new Endpoint("MyEndpoint"); SoapClient client = new SoapClient(binding, wsdl); client.ClientCredentials.UserName.UserName = userN; client.ClientCredentials.UserName.Password = _pasw; await… Read More I have this error System.ServiceModel.Security.MessageSecurityException