On 2011-05-19 22:27, Thomas Kluyver wrote:
On 19 May 2011 21:08, Laurent Gautier <lgaut...@gmail.com <mailto:lgaut...@gmail.com>> wrote:

    >>> ri.NA_Real
    NA_real_
    >>> import sys
    >>> sys.version
    '2.7.1+ (r271:86832, Mar 24 2011, 00:37:39) \n[GCC 4.5.2]'


OK, that's interesting:

>>> ri.NA_Real
0.0
>>> sys.version
'2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) \n[GCC 4.5.2]'

The value of NA_Real can be displayed as 0.0, or as a very small float (e-41 or smaller), which can change on different runs.

Well, technically there is a numerical value behind NA_Real; it is an "NA" by convention. The annoying part is that this is changing from run to run: this is suggesting uninitialized memory.

Does
>>> import ri
>>> ri.R_VERSION_BUILD
correspond to the R version you are running rpy2 against ?

Do you have older versions of rpy2 installed ? If yes, does removing them solve the problem ?


It also gives me another problem: after rpy2.rinterface (or rpy2.robjects) has been imported, doing any more imports fails with a SyntaxError. It's not 100% consistent, but I can reproduce it quite a few times in a row (closing and relaunching the interactive interpreter). This only seems to be the case in 2.7 - I can't reproduce it in 3.2.

>>> import rpy2.robjects
>>> import sys
  File "<stdin>", line 1
    import sys
             ^
SyntaxError: invalid syntax

Thomas

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to