emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How to access tables headers from within code block?


From: Sebastien Vauban
Subject: Re: [O] How to access tables headers from within code block?
Date: Tue, 18 Nov 2014 13:05:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt)

Andreas Hilboll wrote:
> I have a table like this
>
> #+TBLNAME: t_tracers
> | Trace gas | SCIATRAN alias |
> |-----------+----------------|
> | O3        | O3             |
> | NO2       | NO2            |
> | HCHO      | HCHO           |
> | CHOCHO    | NO3            |
> | HONO      | OCLO           |
> | BRO       | BRO            |
> | H2O       | H2O            |
> | O4        | O4             |
>
> and want to access the data from within a Python code block:
>
> #+BEGIN_SRC python :var tracers_raw=t_tracers
> return (tracers_raw)
> #+END_SRC
>
> My problem is that the table headers are apparently not passed to 
> Python, as my results look like this:
>
> #+RESULTS:
> | O3     | O3   |
> | NO2    | NO2  |
> | HCHO   | HCHO |
> | CHOCHO | NO3  |
> | HONO   | OCLO |
> | BRO    | BRO  |
> | H2O    | H2O  |
> | O4     | O4   |
>
> How can I access the table headers also from within the code block?

I don't have Python, but ":colnames yes" should make it.

Best regards,
  Seb

-- 
Sebastien Vauban




reply via email to

[Prev in Thread] Current Thread [Next in Thread]