Hi,
For org tables generated in Python, I use python-tabulate. Actually, I forked the original library to include the possibility of generating the latex attributes from Python too.
Something like:
--- cut here ---
#+BEGIN_SRC python :results value raw :exports results
import math
import pandas as pd
import tabulate
xvals = [math.pi * i / 5 for i in range(10)]
df = pd.DataFrame({
'x': xvals,
'sin(x)' : [math.sin(xvals[i]) for i in range (10)],
'cos(x)' : [math.cos(xvals[i]) for i in range (10)]
})
attrs=':environment longtable :align p{2cm}p{2cm}p{2cm} :placement [h] :center t'
return tabulate.tabulate(
df,
headers=df.columns, tablefmt='orgtbl', floatfmt=".3f",
caption='Table exported from Python with extended tabulate',
label='labextend',
attr_latex=attrs,
showindex=False)
#+END_SRC
#+RESULTS:
--- cut here ---
CAVEAT: the author of python-tabulate wasn't very excited about this ;-)
Best, /PA
--
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler
Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run a leader-deposed hook here, but we can't yet