[SciPy-dev] scipy.stats._chk_asarray

Pierre GM pgmdevlist@gmail....
Tue Jun 2 16:14:19 CDT 2009


On Jun 2, 2009, at 5:03 PM, Robert Kern wrote:

> On Tue, Jun 2, 2009 at 15:56, ctw <lists.20.chth@xoxy.net> wrote:
>> I just wanted to give you a heads up that I came across a bug in
>> scipy.stats._chk_asarray.
>> I have updated the corresponding review page (
>> http://projects.scipy.org/scipy/ticket/44 ) with the following
>> comment:
>>
>> _chk_asarray does not respect the class of the input.

On purpose, as pointed out by Robert.

Now, for simple operations like that, you can use masked arrays:
 >>>  mx=ma.array(matrix(range(4)))
 >>> mx.mean(0)
masked_matrix(data =
  [[0.0 1.0 2.0 3.0]],
               mask =
  [[False False False False]],
         fill_value = 999999)
 >>> mx.mean(0).data
  matrix([[ 0.,  1.,  2.,  3.]])


More information about the Scipy-dev mailing list