Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can try explicitly casting to a data.frame in your yahooImport function.</p> <p>The following worked for me:</p> <pre><code>&gt;&gt;&gt; yahooImport = robjects.r('function(x) as.data.frame(yahooImport(x)@data)') &gt;&gt;&gt; print type(qqq) &lt;class 'rpy2.robjects.vectors.DataFrame'&gt; &gt;&gt;&gt; qqq &lt;DataFrame - Python:0x102412680 / R:0x103c2b310&gt; [Float..., Float..., Float..., Float..., Float..., Float...] Open: &lt;class 'rpy2.robjects.vectors.FloatVector'&gt; &lt;FloatVector - Python:0x10241a638 / R:0x1048f1c00&gt; [58.970000, 58.660000, 59.180000, ..., 102.250000, 102.870000, 102.250000] High: &lt;class 'rpy2.robjects.vectors.FloatVector'&gt; &lt;FloatVector - Python:0x10241acf8 / R:0x104916000&gt; [59.700000, 59.320000, 59.190000, ..., 102.310000, 103.470000, 102.310000] Low: &lt;class 'rpy2.robjects.vectors.FloatVector'&gt; &lt;FloatVector - Python:0x10241add0 / R:0x10491c200&gt; [58.920000, 58.340000, 58.500000, ..., 99.310000, 100.620000, 100.560000] Close: &lt;class 'rpy2.robjects.vectors.FloatVector'&gt; &lt;FloatVector - Python:0x10241aef0 / R:0x10486f800&gt; [59.600000, 58.990000, 58.600000, ..., 100.120000, 102.620000, 102.120000] Volume: &lt;class 'rpy2.robjects.vectors.FloatVector'&gt; &lt;FloatVector - Python:0x10241d050 / R:0x104875a00&gt; [43540100.000000, 70148800.000000, 57085500.000000, ..., 8743600.000000, 9688600.000000, 5232000.000000] Adj.Close: &lt;class 'rpy2.robjects.vectors.FloatVector'&gt; &lt;FloatVector - Python:0x10241d170 / R:0x10485a000&gt; [59.600000, 58.990000, 58.600000, ..., 48.110000, 49.320000, 49.080000] </code></pre> <p>yahooImport returns a timeSeries object which is represented internally as a matrix, which is what is causing your return values in rpy2 to be a matrix.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload