Skip to content
Advertisement

Tag: list

comparing a number of lists in pairs

I have problem with 4 list each one got 4 number: P1= [3,1,3,4] P2= [5,4,3,7] P3= [7,4,8,1] P4= [10,3,2,1] I need to get the biggest number in combinational way like: Pair of 2: p1p2, p1p3, p1p4, p2p3, p2p4, p3p4 Pairs of 3: p1p2p3, p1p2p4, p1p3p4, p2p3p4 Pairs of 4: p1p2p3p4 The result for: p1p2= [5,4,3,7] p1p3= [7,4,8,4] p1p4= [10,3,3,4] ……

Serach List names in a dataframe column pandas

I am trying to match my list of server with the pandas dataframe in the column Server Name if the name in the list matches in the Server Name then print the entire row. there are chances names is the my_List do not match entirely like one of the server name in my_List is tick1001.example.us.com while in Server Name. This

For every consecutive number

I have a list containing data such as [2, 3, 9, 10, 16, 17, 23, 24, 99, 112, 113, 114, 299] and what I would is that, for every set of consecutive numbers, construct a dictionary with the key representing the set of consecutive numbers starting from 1, and the value the consecutive numbers. The expected output should look like

Advertisement