emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Complex numbers
@ 2011-04-12 15:09 Renier Marchand
  2011-04-13  3:52 ` Eric Schulte
  0 siblings, 1 reply; 7+ messages in thread
From: Renier Marchand @ 2011-04-12 15:09 UTC (permalink / raw)
  To: emacs-orgmode

Hi.

I have been playing around with complex data that has been returned
from Python. This is obviously not in calc.el format but if I change
them to the correct format I can manipulate them using calc.

but

When I want to pass the complex numbers (python format) to python I
get an error. If I pass real number everything works as expected

For example:

      #+source: parameter-variation(data=0)
      #+begin_src python :result values
        return 'text'
      #+end_src


      |   |  hmin |                                     |
      |---+-------+-------------------------------------|
      |   |       |                                     |
      |   |  0.05 | (0.0331901438056,0.000535222885197) |
      |   |   0.1 | (0.0333434157791,0.000537930174356) |
      |   |   0.3 | (0.0345727512157,0.000559346040457) |
      |   |   0.6 | (0.0353146483908,0.000571501584524) |
      |   |   0.9 | (0.0355522909393,0.000574387067408) |
      |   |   1.2 | (0.0356575682336,0.000574851263615) |
      |   |  10.0 | (0.0357806926897,0.000575051685084) |
      | $ | x=0.1 | y=0.1                               |
      |   |  text |                                     |
      #+TBLFM: @11$2='(sbe "parameter-variation" (data
@3$2..@9$2))::@11$3='(sbe "parameter-variation" (data @3$3..@9$3))

i.e. I get the word 'text' returned for column 2 where there are real
numbers but I don't get anything returned where there are complex
numbers. As you can see, there are no actual calculation performed on
the data I am just returning 'text' so I am expecting it to work in
both instances.

The debug sessions show the following for the real column:

Substitution history of formula
Orig:   '(sbe "parameter-variation" (data @3$2..@9$2))
$xyz->  '(sbe "parameter-variation" (data @3$2..@9$2))
@r$c->  '(sbe "parameter-variation" (data #("0.05" 0 4 (fontified t
face org-table)) #("0.1" 0 3 (fontified t face org-table)) #("0.3" 0 3
(fontified t face org-table)) #("0.6" 0 3 (fontified t face
org-table)) #("0.9" 0 3 (fontified t face org-table)) #("1.2" 0 3
(fontified t face org-table)) #("10.0" 0 4 (fontified t face
org-table))))
$1->    '(sbe "parameter-variation" (data #("0.05" 0 4 (fontified t
face org-table)) #("0.1" 0 3 (fontified t face org-table)) #("0.3" 0 3
(fontified t face org-table)) #("0.6" 0 3 (fontified t face
org-table)) #("0.9" 0 3 (fontified t face org-table)) #("1.2" 0 3
(fontified t face org-table)) #("10.0" 0 4 (fontified t face
org-table))))
Result: text
Format: NONE
Final:  text

and for the complex column:

Substitution history of formula
Orig:   '(sbe "parameter-variation" (data @3$3..@9$3))
$xyz->  '(sbe "parameter-variation" (data @3$3..@9$3))
@r$c->  '(sbe "parameter-variation" (data
#("(0.0331901438056,0.000535222885197)" 0 35 (fontified t face
org-table)) #("(0.0333434157791,0.000537930174356)" 0 35 (fontified t
face org-table)) #("(0.0345727512157,0.000559346040457)" 0 35
(fontified t face org-table)) #("(0.0353146483908,0.000571501584524)"
0 35 (fontified t face org-table))
#("(0.0355522909393,0.000574387067408)" 0 35 (fontified t face
org-table)) #("(0.0356575682336,0.000574851263615)" 0 35 (fontified t
face org-table)) #("(0.0357806926897,0.000575051685084)" 0 35
(fontified t face org-table))))
$1->    '(sbe "parameter-variation" (data
#("(0.0331901438056,0.000535222885197)" 0 35 (fontified t face
org-table)) #("(0.0333434157791,0.000537930174356)" 0 35 (fontified t
face org-table)) #("(0.0345727512157,0.000559346040457)" 0 35
(fontified t face org-table)) #("(0.0353146483908,0.000571501584524)"
0 35 (fontified t face org-table))
#("(0.0355522909393,0.000574387067408)" 0 35 (fontified t face
org-table)) #("(0.0356575682336,0.000574851263615)" 0 35 (fontified t
face org-table)) #("(0.0357806926897,0.000575051685084)" 0 35
(fontified t face org-table))))
Result:
Format: NONE
Final:


Thank you very much for your help.

Renier

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-04-15 16:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-12 15:09 Complex numbers Renier Marchand
2011-04-13  3:52 ` Eric Schulte
2011-04-13  6:37   ` Renier Marchand
2011-04-13  9:16   ` Renier Marchand
2011-04-13 16:35     ` Eric Schulte
2011-04-15 15:03       ` Renier Marchand
2011-04-15 15:50         ` Eric Schulte

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).