Jan-11-2021, 10:48 PM
Please excuse my ignorance, just trying to learn. This is my first attempt at writing a program myself. I'm self taught through courses on the web. I'm very green at programming, so I apologize in advance if I'm asking a stupid or easy question. People here seem very knowledgeable so I thought this was the place to ask.
I have a 2d array with 5 ints per row (ints 1 to 43)
d5 = np.array
I want to find out if any 2 of the ints from line2 d5[1][] (10 different permutations of 2 of 5) are in line 1 d5[0][]
I have tried soo many attempts at this. Can't even remember what I tried anymore. Tried breaking down into tuples, arrays, lists....and different variations. I 'll try to post some code here for someone to check. Guess I just don't know what I'm doing. BUT, I want to learn. If anyone could point me in the proper direction, it would be much appreciated!!
I have a 2d array with 5 ints per row (ints 1 to 43)
d5 = np.array
I want to find out if any 2 of the ints from line2 d5[1][] (10 different permutations of 2 of 5) are in line 1 d5[0][]
I have tried soo many attempts at this. Can't even remember what I tried anymore. Tried breaking down into tuples, arrays, lists....and different variations. I 'll try to post some code here for someone to check. Guess I just don't know what I'm doing. BUT, I want to learn. If anyone could point me in the proper direction, it would be much appreciated!!
line_no = 1 a = 0 lay_1 = 1 while line_no <= draws_reporting: b = lay_1 two_counter = 0 draw_two = d5[a] # [[d5[a][0], d5[a][1]], [d5[a][0], d5[a][2]], [d5[a][0], d5[a][3]], [d5[a][0], d5[a][4]], # [d5[a][1], d5[a][2]], [d5[a][1], d5[a][3]], [d5[a][1], d5[a][4]], [d5[a][2], d5[a][3]], # [d5[a][2], d5[a][4]], [d5[a][3], d5[a][4]]] for row in d5: two_1 = d5[b][0], d5[b][1] # two_1 = ((d5[b][0], d5[b][1]), (d5[b][0], d5[b][2]), (d5[b][0], d5[b][3]), (d5[b][0], d5[b][4]) # , (d5[b][1], d5[b][2]), (d5[b][1], d5[b][3]), (d5[b][1], d5[b][4]), (d5[b][2], d5[b][3]) # , (d5[b][2], d5[b][4]), (d5[b][3], d5[b][4])) if two_1 not in draw_two: b += 1 two_counter += 1 else: break print(line_no, two_counter) line_no += 1 a += 1 lay_1 += 1