David Huard wrote:

> On Thu, Oct 9, 2008 at 9:40 AM, Neal Becker <[EMAIL PROTECTED]> wrote:
> 
>> David Huard wrote:
>>
>> > Neal,
>> >
>> > Look at: apply_along_axis
>> >
>> >
>> I guess it'd be:
>>
>> b = empty_like(a)
>> for row in a.shape[0]:
>>  b[row,:] = apply_along_axis (func, row, a)
>>
> 
>> I don't suppose there is a way to do this without explicitly writing a
>> loop.
> 
> 
> Have you tried
> 
> b = apply_along_axis(func, 1, a)
> 
> It should work.
> 
Yes, thanks.

The doc for apply_along_axis is not clear.

For one thing, it says:
The output array. The shape of outarr depends on the return value of func1d. If 
it returns arrays with the same shape as the input arrays it receives, outarr 
has the same shape as arr.

What happens if the 'if' clause is not true?


_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to