Skip to content
Advertisement

Intersection of two 2-D numpy arrays with unequal rows and columns

I have 2 arrays, one of shape (455,98) and a second with shape (182,472). A geometric description is as per the attached image. Is there a pythonic way to do this? I would also be happy to receive guidance on how to write a function to achieve this.

enter image description here

Advertisement

Answer

Don’t know if I understood your question completely. However this code will add the numbers from a and b arrays within the intersection.

JavaScript

Could alternatively use something like:

JavaScript

To retrieve both elements from each array.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement