Related
Hamza Arshad: I have nested lists like this: values = [['DNO', 0.2], ['Equinor', 0.4], ['Petoro', 0.2], ['Total', 0.2]]
How can I get all possible combinations of elements that will sum (the second element of each sublist) greater than 0.5? This is what I'm u
Hamza Arshad: I have nested lists like this: values = [['DNO', 0.2], ['Equinor', 0.4], ['Petoro', 0.2], ['Total', 0.2]]
How can I get all possible combinations of elements that will sum (the second element of each sublist) greater than 0.5? This is what I'm u
Luca F. I have a list ['a', 'bill', 'smith']and I want to write a python code to get all possible combinations of applying a specific criterion. To be more precise, I want to get the combination of these three elements in the list plus the first letter of each
Ben : I have a list of 15 numbers and I need to write some code to generate all 32,768 combinations of these numbers. I've found some code (by googling) that apparently does what I want, but I've found the code to be rather opaque and have been cautious about
Ben : I have a list of 15 numbers and I need to write some code to generate all 32,768 combinations of these numbers. I've found some code (by googling) that apparently does what I want, but I've found the code to be rather opaque and have been cautious about
Ben : I have a list of 15 numbers and I need to write some code to generate all 32,768 combinations of these numbers. I've found some code (by googling) that apparently does what I want, but I've found the code to be rather opaque and have been cautious about
cooler I have a list L = [3, 4, 1, 5, 9]and I want to get all possible numbers that can be made by using the numbers present in the list L. I mean, I want to get output like this: [3, 4, 1, 5, 9, 34, . . . . , 91, 953, ... ,41593, ... etc.]I am using the follo
username I have an array of Types and I want to generate all possible combinations for these types. ie: (assumes only int, bool and string) int/bool/string/int, bool/int, string/int, bool, string/int, string, bool/etc I saw Eric Lippert's answer here: Generate
username I'm trying to get all possible patterns from a list like: input_x = ['1', ['2', '2x'], '3', '4', ['5', '5x']]
As we can see it has 2 nested lists ['2', '2x']and ['5', '5x']here. This means that all possible patterns are 4 (2 cells x 2 cells) and the
username I'm trying to get all possible patterns from a list like: input_x = ['1', ['2', '2x'], '3', '4', ['5', '5x']]
As we can see it has 2 nested lists ['2', '2x']and ['5', '5x']here. This means that all possible patterns are 4 (2 cells x 2 cells) and the
username I'm trying to get all possible patterns from a list like: input_x = ['1', ['2', '2x'], '3', '4', ['5', '5x']]
As we can see it has 2 nested lists ['2', '2x']and ['5', '5x']here. This means that all possible patterns are 4 (2 cells x 2 cells) and the
username I'm trying to get all possible patterns from a list like: input_x = ['1', ['2', '2x'], '3', '4', ['5', '5x']]
As we can see it has 2 nested lists ['2', '2x']and ['5', '5x']here. This means that all possible patterns are 4 (2 cells x 2 cells) and the
Daniel Bastos I have a list with elements: atoms and other lists. I ask the following questions: -?totobola([1,x,2,1,x,2,1,x,2,1,x,[1,x],[1,x,2]],LS)。 I want this to be LSa list where I will display each atom and then the possible combinations of lists within
username For example, I have a list of repeating elements array = [2,2,2,7]. If I use the solution suggested in this answer (use ), I get:itertools.combinations() ()
(7,)
(2,)
(2,)
(2,)
(7, 2)
(7, 2)
(7, 2)
(2, 2)
(2, 2)
(2, 2)
(7, 2, 2)
(7, 2, 2)
(7, 2, 2)
(2
Tobias Herman I need a function that does the same thing as itertools.combinations(iterable, r) in python So far I came up with this: {-| forward application -}
x -: f = f x
infixl 0 -:
{-| combinations 2 "ABCD" = ["AB","AC","AD","BC","BD","CD"] -}
combinatio
Tobias Herman I need a function that does the same thing as in pythonitertools.combinations(iterable, r) So far I have come up with this: {-| forward application -}
x -: f = f x
infixl 0 -:
{-| combinations 2 "ABCD" = ["AB","AC","AD","BC","BD","CD"] -}
combin
username For example, I have a list of repeating elements array = [2,2,2,7]. If I use the solution suggested in this answer (use ), I get:itertools.combinations() ()
(7,)
(2,)
(2,)
(2,)
(7, 2)
(7, 2)
(7, 2)
(2, 2)
(2, 2)
(2, 2)
(7, 2, 2)
(7, 2, 2)
(7, 2, 2)
(2
Dalap This is more of a general question and I'm not sure if any algorithm exists to satisfy what I'm thinking, and if it exists so called... Suppose we have three objects (lists) ["object", 1 , "this is object one"]
["object2", 2 , "this is object one"]
["obj
Makasu I am trying to calculate the variance of a stock portfolio. To achieve this, I need to calculate the weighted covariance between assets. I have a class that includes a field to store the weight of each asset in the portfolio and a field to store a list
Makasu I am trying to calculate the variance of a stock portfolio. To achieve this, I need to calculate the weighted covariance between assets. I have a class that includes a field to store the weight of each asset in the portfolio and a field to store a list
Steve Nellion My problem is exactly the same as this one . I have character array (list). I want to get all possible sequence combinations from this list, but limit the number of characters (eg: max 2 characters). Also, a single character cannot be repeated in
Steve Nellion My problem is exactly the same as this one . I have character array (list). I want to get all possible sequence combinations from this list, but limit the number of characters (eg: max 2 characters). Also, a single character cannot be repeated in
Steve Nellion My problem is exactly the same as this one . I have character array (list). I want to get all possible sequence combinations from this list, but limit the number of characters (eg: max 2 characters). Also, a single character cannot be repeated in
username ra_position_preferences = {"yoder3":["J","E","T","S","M","R","B","SS"],
"yoder4":["J","E","S","T","M","R","SS","B"],
"kratz3":["M","J","S","E","T","R","B","SS"],
"miller3
username ra_position_preferences = {"yoder3":["J","E","T","S","M","R","B","SS"],
"yoder4":["J","E","S","T","M","R","SS","B"],
"kratz3":["M","J","S","E","T","R","B","SS"],
"miller3
CMinusMinus: I want to get all combinations of lists: L = ["a","b","c"]
combinations(L,length=2)
# [("a","a"),("a","b"),("a","c"),("b","a"),("b","b"),("b","c"),("c","a"),("c","b"),("c","c")]
I tried itertools.combinations() but it's back [('a', 'b'), ('a', 'c
CMinusMinus: I want to get all combinations of lists: L = ["a","b","c"]
combinations(L,length=2)
# [("a","a"),("a","b"),("a","c"),("b","a"),("b","b"),("b","c"),("c","a"),("c","b"),("c","c")]
I tried itertools.combinations() but it's back [('a', 'b'), ('a', 'c
CMinusMinus: I want to get all combinations of lists: L = ["a","b","c"]
combinations(L,length=2)
# [("a","a"),("a","b"),("a","c"),("b","a"),("b","b"),("b","c"),("c","a"),("c","b"),("c","c")]
I tried itertools.combinations() but it's back [('a', 'b'), ('a', 'c
Oleg Caralanski: I have two arrays: String[] operators = {"+", "-", "*"};
int[] numbers = {48, 24, 12, 6};
I want all possible combinations of string formats like this: 48+24+12+6
48+24+12-6
48+24+12*6
48+24-12+6
48+24-12-6
48+24-12*6
..........
48*24*12*6
T