* How to access tables headers from within code block?
@ 2014-11-18 10:29 Andreas Hilboll
2014-11-18 12:05 ` Sebastien Vauban
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Hilboll @ 2014-11-18 10:29 UTC (permalink / raw)
To: emacs-orgmode
Hi,
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?
Thanks for you help,
Andreas.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: How to access tables headers from within code block?
2014-11-18 10:29 How to access tables headers from within code block? Andreas Hilboll
@ 2014-11-18 12:05 ` Sebastien Vauban
0 siblings, 0 replies; 2+ messages in thread
From: Sebastien Vauban @ 2014-11-18 12:05 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-18 12:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-18 10:29 How to access tables headers from within code block? Andreas Hilboll
2014-11-18 12:05 ` Sebastien Vauban
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.