Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-18 Thread Vincent Schut
Keith Goodman wrote: > On Thu, Aug 6, 2009 at 9:58 AM, Charles R > Harris wrote: >> >> On Thu, Aug 6, 2009 at 9:55 AM, wrote: >>> What's the best way of getting back the correct shape to be able to >>> broadcast, mean, min,.. to the original array, that works for >>> arbitrary dimension and axis?

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-10 Thread Keith Goodman
On Mon, Aug 10, 2009 at 9:10 AM, wrote: > On Mon, Aug 10, 2009 at 11:55 AM, Keith Goodman wrote: >> On Thu, Aug 6, 2009 at 9:07 AM, Robert Kern wrote: >>> On Thu, Aug 6, 2009 at 11:03, Keith Goodman wrote: On Thu, Aug 6, 2009 at 8:55 AM, wrote: > What's the best way of getting back the c

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-10 Thread josef . pktd
On Mon, Aug 10, 2009 at 11:55 AM, Keith Goodman wrote: > On Thu, Aug 6, 2009 at 9:07 AM, Robert Kern wrote: >> On Thu, Aug 6, 2009 at 11:03, Keith Goodman wrote: >>> On Thu, Aug 6, 2009 at 8:55 AM, wrote: What's the best way of getting back the correct shape to be able to broadcast, mean

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-10 Thread Keith Goodman
On Thu, Aug 6, 2009 at 9:07 AM, Robert Kern wrote: > On Thu, Aug 6, 2009 at 11:03, Keith Goodman wrote: >> On Thu, Aug 6, 2009 at 8:55 AM, wrote: >>> What's the best way of getting back the correct shape to be able to >>> broadcast, mean, min,.. to the original array, that works for >>> arbitrary

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-06 Thread josef . pktd
On Thu, Aug 6, 2009 at 1:07 PM, Keith Goodman wrote: > On Thu, Aug 6, 2009 at 9:58 AM, Charles R > Harris wrote: >> >> >> On Thu, Aug 6, 2009 at 9:55 AM, wrote: >>> >>> What's the best way of getting back the correct shape to be able to >>> broadcast, mean, min,.. to the original array, that works

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-06 Thread Keith Goodman
On Thu, Aug 6, 2009 at 9:58 AM, Charles R Harris wrote: > > > On Thu, Aug 6, 2009 at 9:55 AM, wrote: >> >> What's the best way of getting back the correct shape to be able to >> broadcast, mean, min,.. to the original array, that works for >> arbitrary dimension and axis? >> >> I thought I have se

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-06 Thread Charles R Harris
On Thu, Aug 6, 2009 at 9:55 AM, wrote: > What's the best way of getting back the correct shape to be able to > broadcast, mean, min,.. to the original array, that works for > arbitrary dimension and axis? > > I thought I have seen some helper functions, but I don't find them anymore? > Adding a

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-06 Thread Keith Goodman
thanksOn Thu, Aug 6, 2009 at 9:07 AM, Robert Kern wrote: > On Thu, Aug 6, 2009 at 11:03, Keith Goodman wrote: >> On Thu, Aug 6, 2009 at 8:55 AM, wrote: >>> What's the best way of getting back the correct shape to be able to >>> broadcast, mean, min,.. to the original array, that works for >>> arbi

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-06 Thread Robert Kern
On Thu, Aug 6, 2009 at 11:21, wrote: > On Thu, Aug 6, 2009 at 12:07 PM, Robert Kern 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 thoug

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-06 Thread Pierre GM
On Aug 6, 2009, at 12:22 PM, Keith Goodman wrote: > On Thu, Aug 6, 2009 at 9:18 AM, Robert Kern > wrote: >> On Thu, Aug 6, 2009 at 11:15, Keith Goodman >> wrote: >>> thanksOn Thu, Aug 6, 2009 at 9:07 AM, Robert Kern>> > wrote: On Thu, Aug 6, 2009 at 11:03, Keith Goodman wrote: >>

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-06 Thread Keith Goodman
On Thu, Aug 6, 2009 at 9:18 AM, Robert Kern wrote: > On Thu, Aug 6, 2009 at 11:15, Keith Goodman wrote: >> thanksOn Thu, Aug 6, 2009 at 9:07 AM, Robert Kern >> wrote: >>> On Thu, Aug 6, 2009 at 11:03, Keith Goodman wrote: > >> pylab.demean?? Type:           function Base Class:    

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-06 Thread josef . pktd
On Thu, Aug 6, 2009 at 12:07 PM, Robert Kern wrote: > On Thu, Aug 6, 2009 at 11:03, Keith Goodman wrote: >> On Thu, Aug 6, 2009 at 8:55 AM, wrote: >>> What's the best way of getting back the correct shape to be able to >>> broadcast, mean, min,.. to the original array, that works for >>> arbitrary

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-06 Thread Robert Kern
On Thu, Aug 6, 2009 at 11:15, Keith Goodman wrote: > thanksOn Thu, Aug 6, 2009 at 9:07 AM, Robert Kern > wrote: >> On Thu, Aug 6, 2009 at 11:03, Keith Goodman wrote: > pylab.demean?? >>> Type:           function >>> Base Class:     >>> String Form:     >>> Namespace:      Interactive >>> Fil

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-06 Thread Robert Kern
On Thu, Aug 6, 2009 at 11:03, Keith Goodman wrote: > On Thu, Aug 6, 2009 at 8:55 AM, wrote: >> What's the best way of getting back the correct shape to be able to >> broadcast, mean, min,.. to the original array, that works for >> arbitrary dimension and axis? >> >> I thought I have seen some help

Re: [Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-06 Thread Keith Goodman
On Thu, Aug 6, 2009 at 8:55 AM, wrote: > What's the best way of getting back the correct shape to be able to > broadcast, mean, min,.. to the original array, that works for > arbitrary dimension and axis? > > I thought I have seen some helper functions, but I don't find them anymore? > > Josef > >

[Numpy-discussion] add axis to results of reduction (mean, min, ...)

2009-08-06 Thread josef . pktd
What's the best way of getting back the correct shape to be able to broadcast, mean, min,.. to the original array, that works for arbitrary dimension and axis? I thought I have seen some helper functions, but I don't find them anymore? Josef >>> a array([[1, 2, 3, 3, 0], [2, 2, 3, 2, 1]])