emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-mode and python pandas


From: Rasmus
Subject: Re: [O] org-mode and python pandas
Date: Mon, 01 Jul 2013 19:04:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Achim Gratz <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]