[SciPy-dev] scipy.stats._chk_asarray

Robert Kern robert.kern@gmail....
Tue Jun 2 23:55:59 CDT 2009

On Tue, Jun 2, 2009 at 23:50, Pierre GM <pgmdevlist@gmail.com> wrote:
> On Jun 2, 2009, at 11:09 PM, josef.pktd@gmail.com wrote:
>>> I tried to see if I can introduce a second version _check_asanyarray,
>> that doesn't convert to basic np.array, but I didn't get very far.
>> nanmedian, and nanstd are not easy to convert to work with matrices,
>> nanstd uses multiplication and nanmedian uses np.compress
> Well, what about that:
> * convert the inputs to ndarray w/ _chk_asarray
> * compute as usual
> * return a view of the result using the type of the input (using the
> type keyword of view)
> That should work w/ nanmedian. There might be some adjustment to make
> for nanstd (pb of dimensions?)

That is what I was suggesting, only in decorator form so it could be
applied everywhere. It's not worth wasting time making a small handful
of functions work and be inconsistent with all of the others.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

More information about the Scipy-dev mailing list