emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Steven Bagley <stevenbagley@fastmail.fm>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: verbatim export of python code block with numpy array returns wrong value [8.2.1 (8.2.1-10-g9c1ef6-elpaplus @ /Users/sbagley/Dropbox/emacsd/elpa/org-plus-contrib-20131014/)]
Date: Mon, 21 Oct 2013 20:31:27 -0600	[thread overview]
Message-ID: <87sivuqbnk.fsf@gmail.com> (raw)
In-Reply-To: <1382325842.22991.36399041.526C4DD7@webmail.messagingengine.com> (Steven Bagley's message of "Sun, 20 Oct 2013 20:24:02 -0700")

Hi Steve,

Is this a Python problem or is it numpy specific?

Is repr() a numpy or a Python function i.e., could it replace str() in
every Python code block or only when numpy is loaded?

Thanks,

Steven Bagley <stevenbagley@fastmail.fm> writes:

> The following file contents, when exported (to HTML or pdf), produce
> incorrect output:
> #+PROPERTY: header-args:python :session "*Python*"
> #+PROPERTY: exports both
> #+PROPERTY: results value verbatim
> #+BEGIN_SRC python
> import numpy as np
> np.array([1, 2, 3])
> #+END_SRC
>
> The resulting value block contains [1 2 3], which is not the print
> representation of that numpy array. I suspect the problem arises in
> ob-python.el from the use of str() instead of repr(). Thanks.
> --Steve
>
> Remember to cover the basics, that is, what you expected to happen and
> what in fact did happen.  You don't know how to make a good report?  See
>
>      http://orgmode.org/manual/Feedback.html#Feedback
>
> Your bug report will be posted to the Org-mode mailing list.
> ------------------------------------------------------------------------
>
>
>
> Emacs  : GNU Emacs 24.3.1 (x86_64-apple-darwin11.4.2, Carbon Version
> 1.6.0 AppKit 1138.51)
>  of 2013-09-24 on Yukikaze.local
> Package: Org-mode version 8.2.1 (8.2.1-10-g9c1ef6-elpaplus @
> /Users/sbagley/Dropbox/emacsd/elpa/org-plus-contrib-20131014/)
>

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

  reply	other threads:[~2013-10-22  2:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-21  3:24 Bug: verbatim export of python code block with numpy array returns wrong value [8.2.1 (8.2.1-10-g9c1ef6-elpaplus @ /Users/sbagley/Dropbox/emacsd/elpa/org-plus-contrib-20131014/)] Steven Bagley
2013-10-22  2:31 ` Eric Schulte [this message]
2013-10-22  8:09   ` Rasmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sivuqbnk.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=stevenbagley@fastmail.fm \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).