From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastien Vauban Subject: Re: How to access tables headers from within code block? Date: Tue, 18 Nov 2014 13:05:46 +0100 Message-ID: <86d28kaf39.fsf@example.com> References: <546B1FA2.9080307@hilboll.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org 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