[SciPy-dev] Numpy example for arctan2 perhaps wrong/misleading/confusing?

Samuel John scipy at SamuelJohn.de
Mon Jun 9 11:53:05 EDT 2008


Hi Robert!

On Mon, Jun 9, 2008 at 5:27 PM, Robert Kern <robert.kern at gmail.com> wrote:
> This is just something you have to know about ufuncs. Ufuncs simply
> don't do (a1,a2).

I agree, ufuncs are fine the way they are right now. Its just the example
for arctan2 that confused me.

>> It would be perhaps nice to call arctan2 with just ONE array argument
>> and have a broadcasting like this:
>>  arctan2( array([[a1,a2],[b1,b2],[c1,c2]]) )
>>  --> array([arctan2(a1,a2), arctan2(b1,b2), arctan2(c1,c2) ] )
>>
>> and arctan2( array([x,y]) ) --> arctan2(x,y)
>
> No, sorry, that's not going to happen.

I know :-)


> There is no difference between this ufunc and any other.

Hopefully not!


> I think an array example showing the results for each of the four
> quadrants would be ideal in order to show why you would use this over
> arctan().

Yes, this would be best! But I can't think of a vectorized version with arrays.


greetings,
 Samuel



More information about the SciPy-Dev mailing list