emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: org-mode and python pandas
Date: Mon, 01 Jul 2013 19:04:44 +0200	[thread overview]
Message-ID: <87zju6jjo3.fsf@pank.eu> (raw)
In-Reply-To: 87y59qdysz.fsf@Rainer.invalid

Achim Gratz <Stromeko@nexgo.de> writes:

>>> 2. Add to pandas the option of globally influencing the text
>>> formatting so that it outputs something more parsable by org-mode.
>>
>> This sounds promising, if pandas support csv output that will be
>> correctly parsed by Org-mode.
>
> The package already has CSV export, so one could use that.  I don't know
> if you could echo the result directly to the output, all examples
> revolve around putting the CSV into a file.  For Org, TSV output would
> be more natural.

Something like:

from pandas import DataFrame
from numpy.random import rand
from sys import stdout
df = DataFrame(rand(10,3), columns = list('abc'))
df
df.to_csv(stdout, sep="\t", header = True, cols=(1,2))

I was completely unable to get ob-python working this morning, so I
haven't tested it.  I'm using python3, build in python mode and elpy.

In any case, the csv route might be better, as Pandas doesn't print
the table if it's too big (try changing 10 to 1000 above).

-- 
Powered by magic pixies!

  reply	other threads:[~2013-07-01 17:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28  5:26 org-mode and python pandas Dov Grobgeld
2013-06-30 23:15 ` Eric Schulte
2013-07-01 16:34   ` Achim Gratz
2013-07-01 17:04     ` Rasmus [this message]
2013-07-03  9:15       ` Dov Grobgeld
2013-07-03 10:31         ` Rasmus
2013-07-03 14:09         ` Eric Schulte
2015-04-28  8:36           ` Dov Grobgeld
  -- strict thread matches above, loose matches on Subject: below --
2015-04-29  7:12 Dror Atariah

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=87zju6jjo3.fsf@pank.eu \
    --to=rasmus@gmx.us \
    --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).