emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Rudolf Adamkovič" <rudolf@adamkovic.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: Fix "inverted" behavior of `colnames' header argument
Date: Sun, 03 Nov 2024 22:24:23 +0100	[thread overview]
Message-ID: <m2r07sc8oo.fsf@adamkovic.org> (raw)
In-Reply-To: <874j4peb09.fsf@localhost>

Ihor Radchenko <yantar92@posteo.net> writes:

> Our convention is to use [BUG] in subject like to mark bugs.  That's
> what M-x org-submit-bug-report does.

TIL ... again. :)

> What you show looks consistent with "16.4 Environment of a Code Block"
> in Org manual.

Oh, I see.  Wow, that is /really/ confusing from the user's POV.

For anyone reading in the future, to get column names in Pandas, write
`:colnames no' (!) and `pd.DataFrame(VAR[1:], columns=VAR[0])'.

Using the example above, this would be:

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

Canceled.

Rudy
-- 
"Programming reliably -- must be an activity of an undeniably
mathematical nature […] You see, mathematics is about thinking, and
doing mathematics is always trying to think as well as possible."
--- Edsger W. Dijkstra, 1981

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


  reply	other threads:[~2024-11-03 21:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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č [this message]
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=m2r07sc8oo.fsf@adamkovic.org \
    --to=rudolf@adamkovic.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /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).