Org Table from python array

400 views Asked by At

I am having some issues with outputting my python array to an org table.

In short I have an array as such : [[headerA, headerB],[data,data],[data, data]] Anyway my code is setup as follows:

#+begin_src python :tangle yes :exports both :session 
def table():
       # Some code that fills data
       tableData = [[headerA, headerB],[data,data],[data, data]]
       return tableData

table()
#+end_src

Now this gives me no results. But if I add :results output, and then copy the output. AKA my ready to go table. Then:

#+begin_src python :tangle yes :exports both :session 
def table():
       return [[headerA, headerB],[data,data],[data, data]]

table()
#+end_src

It produces my table with no issues. If anyone knows why this is happening, or if it is a bug.

Thanks in advance

0

There are 0 answers