title: Python Merge Two Numpy Arrays Based on Condition
body: <p>How can I merge the following two arrays, by looking up a value from array A in array B?</p>
  
  <p>Array A: </p>
  
  <pre><code>array([['GG', 'AB', IPv4Network('1.2.3.41/26')],
         ['GG', 'AC', IPv4Network('1.2.3.42/25')],
         ['GG', 'AD', IPv4Network('1.2.3.43/24')],
         ['GG', 'AE', IPv4Network('1.2.3.47/23')],
         ['GG', 'AF', IPv4Network('1.2.3.5/24')]],
        dtype=object)
  </code></pre>
  
  <p>and Array B:</p>
  
  <pre><code>array([['123456', 'A1', IPv4Address('1.2.3.5'), nan],
         ['987654', 'B1', IPv4Address('1.2.3.47'), nan]],
        dtype=object)  
  </code></pre>
  
  <p>The goal here is to create Array C, by looking up the IPv4Address from Array B in Array A and comparing them, and getting the corresponding array's second value and storing it:</p>
  
  <p>Array C: </p>
  
  <pre><code>array([['123456', 'A1', IPv4Address('1.2.3.5'), nan, 'AF'],
         ['987654', 'B1', IPv4Address('1.2.3.47'), nan, 'AE']],
        dtype=object) 
  </code></pre>
  
  <p>The ip addresses are of this type: <a href="https://docs.python.org/3/library/ipaddress.html#ipaddress.ip_network" rel="noreferrer">https://docs.python.org/3/library/ipaddress.html#ipaddress.ip_network</a></p>
  
  <p>How can I achieve this?</p>
  
  <h2>edit:</h2>
  
  <p><em>Please note</em> that the merging is conditioned on the IPs matching, so the resulting array C will have the same number of arrays as the Array B, but it will have one more value. The suggested duplicate links are not answering the same question.</p>