Bottom Page

• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 Code problems nats Unladen Swallow Posts: 4 Threads: 3 Joined: Jan 2020 Reputation: 0 Likes received: 0 #1 Jan-11-2020, 03:16 PM Hi, I'm having problems so I hope someone can help. I have two matrices (2d numpy arrays) and I need to make third one by overlapping first two matrices so that result is tuples. So, if first one is M=np.array([[1,2],[5,4]]) and second one N=np.array([[2,6],[9,7]]), third should be (1,2),(2,6) in first row, and (5,9),(4,7) in second row. How can I do that? perfringo Da Bishop Posts: 1,441 Threads: 7 Joined: Jun 2018 Reputation: 145 Likes received: 318 #2 Jan-11-2020, 04:59 PM (This post was last modified: Jan-11-2020, 04:59 PM by perfringo. Edited 1 time in total.) I believe that flatten to 1D, pair columnwise and reshape could deliver desired result. I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame. nats Unladen Swallow Posts: 4 Threads: 3 Joined: Jan 2020 Reputation: 0 Likes received: 0 #3 Jan-11-2020, 09:05 PM I have this (array([1, 2]), array([2, 6]), array([5, 9]), array([4, 7]). How can I compare elements of each pair, eg. 1 with 2, 2 with 6...? perfringo Da Bishop Posts: 1,441 Threads: 7 Joined: Jun 2018 Reputation: 145 Likes received: 318 #4 Jan-13-2020, 12:31 AM Do you want to compare for equality or which is bigger/smaller? I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame. « Next Oldest | Next Newest »

Top Page

Forum Jump:

Users browsing this thread: 1 Guest(s)