[Numpy-discussion] Preventing an ndarray subclass from returning new subclass instances for std(), etc

Stéfan van der Walt stefan at sun.ac.za
Sun Sep 18 12:16:54 EDT 2011

On Sun, Sep 18, 2011 at 9:09 AM, Keith Hughitt <keith.hughitt at gmail.com> wrote:
> I'm sure it is simply a coding error on my part, but so far I havne't been
> able to track it down.

I don't think it's something you've done wrong.  See e.g.:

In [9]: x = np.ma.array([[1,2,3]])

In [10]: np.std(x, axis=0)
masked_array(data = [0.0 0.0 0.0],
             mask = [False False False],
       fill_value = 1e+20)


More information about the NumPy-Discussion mailing list