From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: org-mode and python pandas Date: Mon, 01 Jul 2013 19:04:44 +0200 Message-ID: <87zju6jjo3.fsf@pank.eu> References: <87bo6nkv0e.fsf@gmail.com> <87y59qdysz.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uti2a-0006wJ-RL for emacs-orgmode@gnu.org; Mon, 01 Jul 2013 13:37:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uthp4-0003zm-ML for emacs-orgmode@gnu.org; Mon, 01 Jul 2013 13:23:33 -0400 Received: from plane.gmane.org ([80.91.229.3]:39236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UthX7-0000EC-1p for emacs-orgmode@gnu.org; Mon, 01 Jul 2013 13:04:57 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UthX6-00045B-2n for emacs-orgmode@gnu.org; Mon, 01 Jul 2013 19:04:56 +0200 Received: from business-213-023-238-209.static.arcor-ip.net ([213.23.238.209]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 01 Jul 2013 19:04:56 +0200 Received: from rasmus by business-213-023-238-209.static.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 01 Jul 2013 19:04:56 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Achim Gratz 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!