From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: org-mode and python pandas Date: Mon, 01 Jul 2013 18:34:20 +0200 Message-ID: <87y59qdysz.fsf@Rainer.invalid> References: <87bo6nkv0e.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UthDP-0003Qx-DQ for emacs-orgmode@gnu.org; Mon, 01 Jul 2013 12:44:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UthDN-00048m-Oq for emacs-orgmode@gnu.org; Mon, 01 Jul 2013 12:44:35 -0400 Received: from plane.gmane.org ([80.91.229.3]:45416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uth3g-0006jb-EB for emacs-orgmode@gnu.org; Mon, 01 Jul 2013 12:34:32 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Uth3e-0004oR-Sd for emacs-orgmode@gnu.org; Mon, 01 Jul 2013 18:34:30 +0200 Received: from pd9eb3602.dip0.t-ipconnect.de ([217.235.54.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 01 Jul 2013 18:34:30 +0200 Received: from Stromeko by pd9eb3602.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 01 Jul 2013 18:34:30 +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 Eric Schulte writes: >> | | A | B | C | >> |---+----------+----------+----------| >> | 0 | 0.827817 | 0.664009 | 0.089161 | >> | 1 | 0.170031 | 0.729214 | 0.110918 | >> | 2 | 0.575918 | 0.863924 | 0.757536 | >> | 3 | 0.682722 | 0.774445 | 0.992041 | >> > > What happens if you add ":results table" to your code block? Would that > be sufficient? The problem is that he's trying to consume human-readable output. The alignment in this output is done with spaces, not tabs (as Org would expect). There are more problems considering that the numbers likely lose precision in this format (nota bene: there are other Babel languages that have that same problem). > The default value should be to convert multi-line output to tables, the > ":results table" option above will force this conversion in case it is > currently not taking place due to the default header arguments in use. Since there are no tabs in there, it is impossible to skip empty cells like the first one (they'd have to be written as "" instead, as would be cells that should contain literal spaces). >> 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. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Waldorf MIDI Implementation & additional documentation: http://Synth.Stromeko.net/Downloads.html#WaldorfDocs