From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Re: getting an hline in a python generated table Date: Fri, 03 Apr 2015 14:46:02 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ye6ba-0006gp-Dr for emacs-orgmode@gnu.org; Fri, 03 Apr 2015 14:46:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ye6bV-0001YH-5K for emacs-orgmode@gnu.org; Fri, 03 Apr 2015 14:46:10 -0400 Received: from mail-qc0-x22e.google.com ([2607:f8b0:400d:c01::22e]:33175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ye6bV-0001Y7-10 for emacs-orgmode@gnu.org; Fri, 03 Apr 2015 14:46:05 -0400 Received: by qcrf4 with SMTP id f4so81824554qcr.0 for ; Fri, 03 Apr 2015 11:46:04 -0700 (PDT) In-reply-to: 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: John Kitchin Cc: Orgmode Mailing List Sorry about that. I switched out of Org mode in my email client so C-c C-c sent the email instead of executing the code block. I was mid-sentence... #+BEGIN_SRC python :results table :exports results from tabulate import tabulate import pandas as pd df = pd.DataFrame(np.random.rand(2,2), index=['foo','bar']) tab = tabulate(df, ['col1','col2'], tablefmt='orgtbl') print tab[1:-1] #+END_SRC #+RESULTS: > I'm compensating for some bugs here. The tab[1:-1] is from, I think, tabulate, or perhaps IPython. I don't get results without this being a > Since I use Org + IPython, I find that my > > On 2015-04-01 at 16:07, John Kitchin wrote: >> Hi everyone, >> >> In emacs-lisp, I can get a table as output that has a horizontal line >> in it like this: >> >> (append '((name scopus-id h-index n-docs n-citations)) >> '(hline) >> (some expression that generates a list)) >> >> The first row is header names, then a horizontal line, followed by a row >> for each thing of interest. This seems to work because the result is an >> emacs-lisp "array". >> >> I cannot figure out if this is possible in a Python block though. So far >> my experiments have failed because I don't know how to make an hline >> symbol in a Python array. Any kind of string just shows as a row. Any >> thoughts on if this is possible? >> >> thanks, > > > #+OPTIONS: tex:imagemagick > #+OPTIONS: toc:0