title: How to convert Python Pandas Dataframe to R data.frame
body: <p>I'm using the R package <code>PythonInR</code>, and wanted to convert the pandas dataframe to R dataframe using function <code>pyGet()</code>, but I got the error below:</p>
  
  <blockquote>
    <p>Error in as.data.frame.default(xi, optional = TRUE, stringsAsFactors = stringsAsFactors) : cannot coerce class ""PythonObject"" to a data.frame</p>
  </blockquote>
  
  <p>The text.csv file only contains two columns, name(string) and value(int).
  The code is as below:</p>
  
  <pre><code>library(PythonInR) 
  pyConnect() 
  pyIsConnected() 
  pyVersion()
  pyOptions("usePandas", TRUE) 
  pyImport("pandas", as="pd") 
  test_code &lt;-'py_df = pd.read_csv("test.csv")' 
  pyExec(code = test_code) 
  r_df &lt;- pyGet("py_df")
  </code></pre>
  
  <p>And the output of the code is:</p>
  
  <pre><code>library(PythonInR)
  pyConnect()
  R is already connected to Python!
  pyIsConnected()
  [1] TRUE
  pyVersion()
  [1] "3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)]"
  pyOptions("usePandas", TRUE)
  pyImport("pandas", as="pd")
  test_code &lt;- 'py_df = pd.read_csv("test.csv")'
  pyExec(code = test_code)
  r_df &lt;- pyGet("py_df")
  </code></pre>
  
  <blockquote>
    <p>Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : 
          cannot coerce class ""PythonObject"" to a data.frame</p>
  </blockquote>
  
  <p>Can anyone help to suggest how to convert a Pandas data frame to R data.frame using <code>PythonInR</code>?</p>