<div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">I'm trying to subclass an ndarray so that I can add some additional fields. When I do this however, I get new odd behavior when my object is passed to a variety of numpy functions. For example nanmin returns now return an object of the type of my new array class, whereas previously I'd get a float64. Why? Is this a bug with nanmin or my class?</p><pre class="gmail-lang-py gmail-prettyprint gmail-prettyprinted" style="margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);color:rgb(57,51,24);word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit"><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">import</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> numpy </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">as</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> np

</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">class</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">NDArrayWithColumns</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">np</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">ndarray</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">):</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
    </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">def</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> __new__</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">cls</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> obj</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> columns</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">None</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">):</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
        obj </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> obj</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">view</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">cls</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
        obj</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">columns </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> tuple</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">columns</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
        </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">return</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> obj

    </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">def</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> __array_finalize__</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">self</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> obj</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">):</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
        </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">if</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> obj </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">is</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">None</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">:</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">return</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
        self</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">columns </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> getattr</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">obj</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'columns'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">None</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">

NAN </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> float</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">"nan"</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
r </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> np</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">array</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">([</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">1.</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">0.</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">1.</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">0.</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">1.</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">0.</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">1.</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">0.</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">NAN</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">1.</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">1.</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">])</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">print</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">"MIN"</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> np</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">nanmin</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">r</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">),</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> type</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">np</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">nanmin</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">r</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">))</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span></code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">gives:</p><pre class="gmail-lang-py gmail-prettyprint gmail-prettyprinted" style="margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);color:rgb(57,51,24);word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit"><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">MIN </span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">0.0</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"><</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">type </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'numpy.float64'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">></span></code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">but</p><pre class="gmail-lang-py gmail-prettyprint gmail-prettyprinted" style="margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);color:rgb(57,51,24);word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit"><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">>>></span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> r </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-typ" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">NDArrayWithColumns</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">r</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">[</span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">"a"</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">])</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">>>></span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">print</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">"MIN"</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> np</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">nanmin</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">r</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">),</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> type</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">np</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">nanmin</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">r</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">))</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
MIN </span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">0.0</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"><</span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">class</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-str" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">'__main__.NDArrayWithColumns'</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">></span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">>>></span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">print</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> r</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">shape   # ?!
</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">11</span><span class="gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,)</span></code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">Note the change in type, and also that str(np.nanmin(r)) shows 1 field, not 11 as indicated by its shape. This seems wrong. Is there a way to get my subclass to behave more like an ndarray?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">I realize from the docs that I can override __array_wrap__, but its not clear me how how to use it to solve this issue. Or whether its the right tool.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">In case you're interested, I'm subclassing because I'd like to track column names in matrices of a single type. This is pretty common wish in scikit pipelines. Structured arrays and record type arrays allow for varying type. Pandas provides this functionality, but dealing with numpy arrays is easier (and more efficient) when writing cython extensions. Also, I think the ┬ástructured arrays and record types are unlikely to play nice with cython because they're more freely typed -- I want to deal exclusively with arrays of doubles.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">Any thoughts of how to subclass ndarray and keep original behavior in ufuncs?</p></div>