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

Stéfan van der Walt stefan@sun.ac...
Sun Sep 18 11:16:54 CDT 2011


On Sun, Sep 18, 2011 at 9:09 AM, Keith Hughitt <keith.hughitt@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)
Out[10]:
masked_array(data = [0.0 0.0 0.0],
             mask = [False False False],
       fill_value = 1e+20)

Regards
Stéfan


More information about the NumPy-Discussion mailing list