On 2013-03-21 07:36, Thomas Kluyver wrote:
> On 21 March 2013 14:28, Laurent Gautier <lgaut...@gmail.com 
> <mailto:lgaut...@gmail.com>> wrote:
>
>     In Python this is an error.
>     >>> x+3
>     Traceback (most recent call last):
>       File "<stdin>", line 1, in <module>
>     TypeError: can only concatenate list (not "int") to list
>
>
> With a list, yes. With a numpy array, which is probably as relevant 
> for many rpy2 users, adding an integer adds it to every element:
>
> In [4]: x + 1
> Out[4]: array([1, 2, 3])

In that case, the idea that if anyone needs something like the numpy 
interface, then the best would be to provide The numpy interface. It is 
possible to wrap the object in a numpy array (with a minimal cost since 
copying can be avoided thanks to the buffer protocol).

See:
http://rpy.sourceforge.net/rpy2/doc-2.3/html/numpy.html#low-level-interface

>
> Thomas
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
>
>
> _______________________________________________
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to