emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Fix "inverted" behavior of `colnames' header argument
@ 2024-11-02 16:44 Rudolf Adamkovič
  2024-11-02 18:39 ` Ihor Radchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Rudolf Adamkovič @ 2024-11-02 16:44 UTC (permalink / raw)
  To: emacs-orgmode

When loading Org tables into Pandas data frames, the

  `colnames' does exactly what it should not,

in that "yes" means "no" and vice versa:

  =colnames= set to =yes=:
  
  #+HEADER: :colnames yes
  #+HEADER: :session *Python*
  #+HEADER: :var INPUT = 20a0ea41-3669-482c-989e-d28486d5d400
  #+BEGIN_SRC python
  import pandas as pd
  pd.DataFrame(INPUT)
  #+END_SRC
  
  #+RESULTS:
  :     0   1
  : 0  10  20
  : 1  30  40
  
  =colnames= set to =no=:
  
  #+HEADER: :colnames no
  #+HEADER: :session *Python*
  #+HEADER: :var INPUT = 20a0ea41-3669-482c-989e-d28486d5d400
  #+BEGIN_SRC python
  import pandas as pd
  pd.DataFrame(INPUT)
  #+END_SRC
  
  #+RESULTS:
  :     0   1
  : 0   A   B
  : 1  10  20
  : 2  30  40

Confirmed on Stack Overflow (Sep 1, 2023):

https://stackoverflow.com/a/67091398/1306956

Rudy
-- 
"I love deadlines.  I love the whooshing noise they make as they go by."
--- Douglas Adams, The Salmon of Doubt, 2002

Rudolf Adamkovič <rudolf@adamkovic.org> [he/him]
http://adamkovic.org


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-11-09 15:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-02 16:44 Fix "inverted" behavior of `colnames' header argument Rudolf Adamkovič
2024-11-02 18:39 ` Ihor Radchenko
2024-11-03 21:24   ` Rudolf Adamkovič
2024-11-03 22:10     ` Rudolf Adamkovič
2024-11-03 23:53       ` Rudolf Adamkovič
2024-11-09 15:03         ` Ihor Radchenko
2024-11-04 20:06     ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).