In the following example, I create a very simple pandas DataFrame and export results verbatim:
#+BEGIN_SRC python :exports both :results verbatim :return test
import pandas as pd
test = pd.DataFrame({'A': [1000, 1000], 'B' : [60, 100]})
#+END_SRC
#+RESULTS:
: A B
: 0 1000 60
: 1 1000 100
If I try to have the output as a table, things get messed up:
#+BEGIN_SRC python :exports both :results value table :return test
import pandas as pd
test = pd.DataFrame({'A': [1000, 1000], 'B' : [60, 100]})
#+END_SRC
#+RESULTS:
| A B |
Is there any way to fix this?
Expected output:
| | A | B |
| 0 | 1000 | 60 |
| 1 | 1000 | 100 |
:session
header to your python code block?org-babel-python-evaluate-external-process
where if ":results table" is used I see the variable "raw" ending up containing None instead of the expected results. Co-incidentally this the second org-babel problem I've seen today so perhaps it might be worth trying an updated version of org? According to orgmode.org the latest stable version is 9.0.5 which may be somewhat improved...