Skip to main content

All Questions

3 votes
1 answer
3k views

I have a list of list of floats like this numbers = [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9] I want a python code that can generate all possible combinations for given sum (=1) and a given number of ...
ProgrX's user avatar
  • 141
0 votes
1 answer
32 views

Let's say I have the following dictionary: the_dictionary_list = {'Color': ['Amarillo.png', 'Blanco.png', 'Rojirosado.png', 'Turquesa.png', 'Verde_oscuro.png', 'Zapote.png'], '...
NoahVerner's user avatar
2 votes
1 answer
497 views

I have lists containing sublists. From theses lists I want to retrieve all combinations of integers that are in ascending order. Also the order of the sublists is important (see expected output). It ...
chatax's user avatar
  • 998
0 votes
1 answer
1k views

I have the following list of events that have a binary outcome (i.e. 1 or 0): events=['A', 'B', 'C'] outcomes=[True,False] in each scenario, only one of these outcomes can be True. Is there a way to ...
beginner_python's user avatar
0 votes
2 answers
350 views

According to the question presented here: Python itertools.combinations: how to obtain the indices of the combined numbers, given the following code: import itertools my_list = [7, 5, 5, 4] pairs = ...
Maf's user avatar
  • 763
-3 votes
2 answers
134 views

So I have a 360 element list that I want to find the highest sum of 11 numbers combination, but with a condition.To make it a bit clearer: 1-Gets a list as input 2-Create a combination list with 11 ...
Jacob George's user avatar
0 votes
0 answers
45 views

l have 9000 array of arrays called my_data=(9000,). Each array is composed of a number of arrays. len(my_data[0])=345 arrays# each array of 2000 values len(my_data[700])=222 arrays s# each array of ...
Taylor's user avatar
  • 127
0 votes
0 answers
526 views

I have a function that I would like to apply on each element of a cartesian product of a linear space. I do know how to do it with functions of one variable that is defined using lambda, namely using ...
splinter's user avatar
  • 3,937
3 votes
1 answer
2k views

I have a numpy array that is roughly equivalent to: data = ([1, 2, 3], [4, 5, 6], [7, 8, 9]) I want to find all the unique two-index combinations of these values. In other words, I want all the ...
user avatar
2 votes
3 answers
506 views

arr1=['One','Two','Five'],arr2=['Three','Four'] like itertools.combinations(arr1,2) gives us ('OneTwo','TwoFive','OneFive') I was wondering is there any way applying this to two different arrays.?I ...
anderson's user avatar
  • 107
2 votes
2 answers
1k views

arr=['one','two','three'] Result must be like this: onetwo,twothree,onethree itertools.permutations will not work in this situation. we can do this by simply adding for loops and appending them ,...
Sriker Ch's user avatar
  • 143