Join two python arrays via index
<p>i have a problem in Python. I am creating two numpy arrays from dict entries. I want to join those two numpy arrays in a specific way like this:</p>

<pre><code># create array with classes
probVec = filePickle['classID']
a = np.empty([0, 1])

for x in np.nditer(probVec):
    a = np.append(a,x)

timeVec = filePickle['start']
timeVec = np.asarray(timeVec)
b = np.empty([0, 1])

for x in np.nditer(timeVec):
    b = np.append(b,x)

# create input-vectors for clustering
c = np.vstack((b,a)).transpose()
</code></pre>

<p>Now, if i want to join them in a more specific way, like taking only specific items of array "probVec" to join them with the corresponding entry of array "timeVec" like this:</p>

<pre><code>for x in np.nditer(probVec):
    if x == 3.0:
        a = np.append(a,x)

for x in np.nditer(timeVec):
    b = append with x values that have the same indices as the ones appended in the first loop
</code></pre>

<p>Because both arrays contain values corresponding to each other they have the same length. So my goal is something like this:</p>

<pre><code>probVec = [2.0, 1.0, 3.0, 3.0, 4.0, 3.0...]

timeVec = [t1, t2, t3, t4, t5, t6...]

c = [[3.0 t3]
     [3.0 t4]
     [3.0 t6]
         .
         .
         .
     ]
</code></pre>

<p>I just don't know what's the best way to realize that.</p>