Calling J from Python

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Mon Feb 5 15:25:10 EST 2007


Alexander Schmolck a écrit :
> Larry Bates <larry.bates at websafe.com> writes:
> 
> 
>>And why is that superior to this:
>>
>>def avg(l):
>>    return float(sum(l))/len(l)
>>
>>
>>>>>avg([1,2,3,4])
>>
>>2.5
> 
> 
> Apart from being less to type and it is superior in that it's generalizes much
> better, e.g:
> 
> avg&.^.   NB. geomtric mean
> avg&.%    NB. harmonic mean
> avg M     NB. column mean of matrix M
> avg"1 M   NB. row mean of matrix M
 > 'as

Would my beloved wife's life depend on it, I just couldn't say what all 
this garbage is supposed to mean. If that's supposed to be "superior", 
I'm quite happy with my inferior favorite languages...



More information about the Python-list mailing list