[SciPy-user] diff function, different from MatLab ...

Stef Mientki s.mientki at ru.nl
Wed May 9 08:05:20 EDT 2007


hi Matthieu,

Matthieu Brucher wrote:
> Hi,
>
> I suppose that if s is a boolean array, diff is a boolean array as 
> well. Matlab works on doubles every time, not numpy, and your result 
> is coherent in a boolean algebra.
I guess you're right,

and also integer is not "upsized" to float:  5/3 = 1
(but I believe that's a still a discussion for the Python 3 ;-)

on the other hand, some functions do upsize the result
sqrt(4) = 2.0
sqrt(-4) = 2j

I think I've just to familiarize with this ;-)

thanks,
Stef Mientki



More information about the SciPy-User mailing list