From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id uFOgDYi4Sl+pawAA0tVLHw (envelope-from ) for ; Sat, 29 Aug 2020 20:20:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id QBCICYi4Sl9yTwAA1q6Kng (envelope-from ) for ; Sat, 29 Aug 2020 20:20:24 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 121D4940E97 for ; Sat, 29 Aug 2020 20:15:24 +0000 (UTC) Received: from localhost ([::1]:41492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kC7Fy-0003LS-T8 for larch@yhetil.org; Sat, 29 Aug 2020 16:15:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kC7FY-0003L7-2R for emacs-orgmode@gnu.org; Sat, 29 Aug 2020 16:14:56 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:53759) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kC7FU-0006zy-7i for emacs-orgmode@gnu.org; Sat, 29 Aug 2020 16:14:55 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id C85E5E1BEF; Sat, 29 Aug 2020 16:14:49 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version :content-type; s=sasl; bh=xzIYlvIa5cFcp1MAnIOKZTlvCbE=; b=NGq9wl VIHy6tSU0mFogRPj6mDA3CTRLleGvSwcig3tIMcjpa9WSfIY5boZ+H9URuBqI7hc smcQGHugIf7dNP91Yw9uk91QuLdNxVI0wY1jTK/lG0pfH9AARLEIDyx74/Q9Xmsa kHHk2Ap7pd7Ig9nWycs4CRaozV7JU8lGAEkIA= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id BFE8BE1BEE; Sat, 29 Aug 2020 16:14:49 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:cc:subject:in-reply-to:references:date:message-id:mime-version:content-type; s=mesmtp; bh=FNtm/alC0DJqr/Vp70R2o0wwPRnV7b5zDnDTMPcWyWk=; b=bmwbWi29Xx4s5RDGZGiuNI4Mni4UsG5cYAYw6GdxRSNes3Mp7NtlnbuesCQblxeIgFDxPzVoLKrXuYI/XN0nHHHMRh/RTay5OUD5UlgVcaIUE4UGlfkd2t9ioRiScBvim1Rtx1P7+Wh9U10TZfq0NJ/utjxhmfS++ZQv6M2f66o= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 489F8E1BED; Sat, 29 Aug 2020 16:14:47 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: Jack Kamm Subject: Re: [PATCH] Expanded ob-python results handling and plotting In-Reply-To: <87eenpfe77.fsf@gmail.com> References: <87eenpfe77.fsf@gmail.com> Date: Sat, 29 Aug 2020 16:14:45 -0400 Message-ID: <871rjptdje.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 490EBF74-EA34-11EA-9964-F0EA2EB3C613-24757444!pb-smtp20.pobox.com Received-SPF: pass client-ip=173.228.157.52; envelope-from=kyle@kyleam.com; helo=pb-smtp20.pobox.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/29 15:47:48 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-TUID: BX3HahThko32 Jack Kamm writes: > The attached patch adds ob-python value results handling for the > following types of results: > > - Dictionaries > - Numpy arrays > - Pandas dataframes > - Matplotlib figures Thanks. Just a couple of drive-by comments... > + try: > + import pandas as pd > + except ModuleNotFoundError: ModuleNotFoundError wasn't added until Python 3.6, so I think it'd be better to use its parent class, ImportError. > + pass > + else: > + if isinstance(result, pd.DataFrame): > + result = [[''] + list(result.columns), None] + \ > +[[i] + list(row) for i, row in result.iterrows()] Should handling of Series also be added?