emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Rudolf Adamkovič" <rudolf@adamkovic.org>
To: emacs-orgmode@gnu.org
Subject: Fix "inverted" behavior of `colnames' header argument
Date: Sat, 02 Nov 2024 17:44:33 +0100	[thread overview]
Message-ID: <m2ttcpd1qm.fsf@adamkovic.org> (raw)

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


             reply	other threads:[~2024-11-02 16:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-02 16:44 Rudolf Adamkovič [this message]
2024-11-02 18:39 ` Fix "inverted" behavior of `colnames' header argument 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-04 20:06     ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2ttcpd1qm.fsf@adamkovic.org \
    --to=rudolf@adamkovic.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).