[SciPy-dev] PEP: Improving the basic statistical functions in Scipy
Fri Feb 27 17:27:49 CST 2009
On Fri, Feb 27, 2009 at 6:01 PM, Eric Firing <firstname.lastname@example.org> wrote:
> Pierre GM wrote:
>> On Feb 27, 2009, at 4:52 PM, email@example.com wrote:
>>> For most of the current statistical functions, with the exception of
>>> different tie handling, I think that we can expand the _chk_asarray to
>>> do the necessary preprocessing.
>> Mmh. _chk_asarray will always return a MA. Is it what you want? Are you
>> An idea is then to use the 'usemask' parameter I was talking about
>> * if usemask is False (default), return a ndarray
>> * If usemask is True, return a MA
>> * if the input is a MA (w/ or w/o missing values), set usemask to
>> True, and mask the NaNs/Infs first w/ ma.fix_invalid.
> This may not be appropriate for scipy, but for my own purposes I
> included a third option for the similar "masked" kwarg in a simple stats
> masked='auto' makes the output masked if and only if the input is masked.
Yes, your class looks similar to what I have in mind. But I didn't see
a license statement to know whether I'm allowed to look. Also, your
broadcastable (squeeze) option looks like a very useful idea.
Two differences that I think of are to have the main part in ndarrays
while your _y is a masked array, and at this stage we won't switch to
classes for the basic statistical functions. Additionally, if I
rewrite these functions I would like to get also weights in.
More information about the Scipy-dev