 <p>I humbly propose that you're using the wrong data structure. Notice that if you have an array column that has unique values between 1 and N (an index column) you could encode the same data simply by re-ordering your other columns. Once you're re-ordered your data, not only can you drop the "index" column but now it becomes easier to operate on the remaining data. Let me demonstrate:</p> <pre><code>import numpy as np N = 5 a = np.array([[1, 5], [2,6], [3,3], [4,2]]) b = np.array([[3, 1], [4,2], [1,8], [2,4]]) a_trans = np.ones(N) a_trans[a[:, 0]] = a[:, 1] b_trans = np.ones(N) b_trans[b[:, 0]] = b[:, 1] c = a_trans / b_trans print c </code></pre> <p>Depending on the nature of your problem, you can sometimes use an implicit index from the beginning, but sometimes an explicit index can be very useful. If you need an explicit index, consider using something like <code>pandas.DataFrame</code> with better support for index operations.</p>