On Thu, Aug 6, 2009 at 11:21, <josef.p...@gmail.com> wrote:
> On Thu, Aug 6, 2009 at 12:07 PM, Robert Kern<robert.k...@gmail.com> wrote:

>> if axis != 0:
>>    ind = [slice(None)] * x.ndim
>>    ind[axis] = np.newaxis
>>
>
> Thanks, that's it.
>
> I have seen implementation of helper functions similar to this in
> other packages, but I thought there is already something in numpy.  I
> think this should be a simple helper function in numpy to avoid
> mistakes and complicated implementation like the one in stats.nanstd
> even if it's only a few lines.

It would make a good contribution to numpy.lib.index_tricks.

-- 
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
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to