From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 6MVhIrbpS2O3OAEAbAwnHQ (envelope-from ) for ; Sun, 16 Oct 2022 13:23:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id SMCJIrbpS2O/IgAA9RJhRA (envelope-from ) for ; Sun, 16 Oct 2022 13:23:34 +0200 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 0BBA31FAC0 for ; Sun, 16 Oct 2022 13:23:34 +0200 (CEST) Received: from localhost ([::1]:50922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ok1jw-0004RR-GY for larch@yhetil.org; Sun, 16 Oct 2022 07:23:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ok1jJ-0004Qv-FW for emacs-orgmode@gnu.org; Sun, 16 Oct 2022 07:22:53 -0400 Received: from mout02.posteo.de ([185.67.36.66]:58371) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ok1jH-0006iY-Cf for emacs-orgmode@gnu.org; Sun, 16 Oct 2022 07:22:53 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id D604B240104 for ; Sun, 16 Oct 2022 13:22:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665919368; bh=L8P/PNLla6gCQtDnOFaDemWOTRPi8dMeOUKq9/tAhr4=; h=From:To:Cc:Subject:Date:From; b=sDnbYISuduw5bOQ970adSpHTIwNHaN+wGDD/9QE0ZaFzdTuLK2/ygi6Kcmlpo7aQu wXCcPUIYQnElS22fHQrHHNmERG7k2SioRCv5+A0TDuM6m7JQYH1FEvZpFnDPf6K4EF 3qqRy3bOw5IgxXjJyAmTSSsHnFpp6E5RD840ID+hojXXB8CDlew/aoZH4F0ob4Or93 vxi+Ffq3z25QGRM7TNwlrATU8A9BGmsb6dGHTacujffLYKGi3oB8NMONjWgcwoAc6e nIx0MfUseXzjjpfJ+/3nEDAqE6ziSJu+sPVs95r+Dbd57A10UrfgS8iHdbd0xCiGCY 8xvXfgWXgsopQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MqyQv2FX6z9rxP; Sun, 16 Oct 2022 13:22:46 +0200 (CEST) From: Ihor Radchenko To: sebastien.rey-coyrehourcq@univ-rouen.fr Cc: emacs-orgmode@gnu.org Subject: Re: Org babel Python and R, table not transformed when :var is called ? In-Reply-To: <91cb65e0-4b2c-92ae-a69f-4d9ad8b3e1e3@univ-rouen.fr> References: <91cb65e0-4b2c-92ae-a69f-4d9ad8b3e1e3@univ-rouen.fr> Date: Sun, 16 Oct 2022 11:23:30 +0000 Message-ID: <87czasnhal.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665919414; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=L8P/PNLla6gCQtDnOFaDemWOTRPi8dMeOUKq9/tAhr4=; b=lPPSmMQGyDutyhLky37hF4amUtBl2jps8KVkWOKLVMEQUuZdy+CWh3FXFsbTmTKxIvhZQv 9N5qBhZ4KC1t3hKAZXoXx7xZPCdPTSIUnxmQaJn0eheiTMfM/qhl8LfYk0JXpAInqX16ra v1c4qc3Mjr9UzyOslEgipc2C/wVG41APZV47LoBTd3yC6yroGSkFSD0BPqGcWYW4P3ZwlU F/JNsssh006grrqtdcIr2CO9ZKRptG9xs/BAGiwV0vc1E2DLhOwhaWkd5o0R8fVaJQWZaz q3s8LzCk2D6XvHDkxNGBUA41ZlTsSGfb9sCmGSQjMu4VFhFK3Ccp/gmAOLV59Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665919414; a=rsa-sha256; cv=none; b=AUgpv1sM/Ab31M6EWA4LescrnQKeKpqEjeIIaXlqHVsL2NmQ1bmrsVCvTOHzuxT83txyvb OTRnnnN2/s9IL9VGUcLEpW5TObAArBA+cxZlaMMldOz+eX4vxJozSDKrHEAjspZLte4Bqk Y7NQFL1bQwcXRRRCElfDsOY8nxag/fSrgwTS7vNM98q4FSjDoydcCj0Rux1rIUWmLIv29h wq10rv5TZ2ugcmCR7UV790n6ft7VyYZn+KevVDCXq4o7ezNnck3o/aL6DQdSGuSr/2ia4c /24Lzk8CNJCt5DE/u3NWbAJ3KxtRw6TTGFDnhDAQzyIKl9fB7x5ik7cYwMBvWQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=sDnbYISu; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -0.90 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=sDnbYISu; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 0BBA31FAC0 X-Spam-Score: -0.90 X-Migadu-Scanner: scn1.migadu.com X-TUID: 1cUetgwKUNEY S=C3=A9bastien Rey-Coyrehourcq writes: > Perhaps it's a bug, or something i don't understand, i post on reddit=20 > (https://www.reddit.com/r/emacs/comments/r5yt4a/r_talking_with_python_usi= ng_orgtable_not_work/)=20 > to see if people on org community know the problem. > > I cross post here to see if it's a know bug or somethings ? > > There is something i don't understand, > a difference between behavior of org-babel and org-mode when you use org= =20 > table to pass data using or not using :var. > > |#+NAME:mypythoncode #+begin_src python :results value raw :output=20 > :return tabulate(df, headers=3Ddf.columns, tablefmt=3D'orgtbl') AFAIU, your tabulate call returns string, not a python table. So, :var assignment indeed assigns a string. The returned string also happens to use Org table format, which is why results block is an Org table. By putting #+NAME to results block, you will be referring to its Org syntax, which is then converted from Org table to R table, in contrast to from Python result string to R string. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at