On 12/05/10 22:17, John Owens wrote:
> Sorry, there was one bit of legacy code in there (didn't
> affect the error messages). Here's better:
>
> #!/usr/bin/env python2.6
> import rpy2.robjects as ro
>
> df = ro.DataFrame({'a': ro.IntVector((1,2,3)), 'b': ro.IntVector((4,5,6))})
> print df
> print df.colnames
> print df.rx2('a')
> print [x for x in df.rx2('Date')]

print(df.colnames) does not return any name like 'Date', therefore

 >>> print(df.rx2('Date'))
NULL

(this is so to be consistent with R's behavior, irrespective of the fact 
that raising an exception could have been nicer).


> for k,v in df.rx2('a').iteritems():
>      print k,v
>
> JDO
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list


------------------------------------------------------------------------------

_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to