On Sat, Jul 26, 2008 at 3:38 PM, laurent oget <[EMAIL PROTECTED]> wrote:
> Here you are:
>
>>>> from rpy import *
>>>> a=[1,2,3,4]
>>>> b=r['<'](a,3)
>>>> b
> [True, True, False, False]

You can of course do this in pure python, which might be easier
depending on why you want to do this.

a = [1,2,3,4]
b = [x<3 for x in a]

Or using numpy,

a = numpy.array([1,2,3,4], numpy.int)
b = a < 3

Peter

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to