Replying to myself, for later reference:
I found a workaround, which consists of converting the numpy.float into
a sage float. If I change the respective line to:
tabledata = [(fb_names[i], n(fb_values_10[i])) for i in [0..8]]
it will display the table just fine. The advantage is that one can also
limit the number of digits to be displayed, e.g. n(fb_values_10[i],
digits=3) for better readability.
I still think that the \texttt problem is a bug, but if no-one else is
troubled by it, it's probably not worth creating a ticket.
Cheers
Stan
On 30/06/10 10:15, Stan Schymanski wrote:
Dear all,
As reported in
http://groups.google.com/group/sage-support/browse_thread/thread/b35dc4f890f48677/32bce5d080ef80d1?lnk=gst&q=texttt#32bce5d080ef80d1,
the control sequence \texttt leads to an error in Jsmath. This is
supposed to be solved in Sage 4.4, but when I use html.table() to
display numpy.array data in Sage 4.4.3, I still see the message
"Unknown control sequence '\texttt'" instead of the data.
Notebook code to reproduce:
{{{id=973|
import numpy as np
///
}}}
{{{id=971|
fb_names = ['lambdagf', 'wsgexp', 'lambdafac', 'wsexp', 'pc',
'rootdepth',
'mdstore', 'rgdepth', 'ncp']
fb_values_10 = np.array([ 1.56162258e+03, -7.96780914e-01,
1.47235942e+03,
-4.19180237e-01, 2.78293356e-01, 1.65211304e+00,
1.00000000e+02, 1.00000000e+00, 7.24037931e+03])
///
}}}
{{{id=974|
tabledata = [(fb_names[i], fb_values_10[i]) for i in [0..8]]
html.table(tabledata,header=False)
}}}
For some reason, if I replace in the last command the array
"tabledata" by copy and paste of the data contained in tabledata, the
\texttt is not preparsed any more and the display is correct. It seems
to be an error in the interpretation of the numpy.array data. This
worked without problems in sage 4.1. Any ideas how to fix this?
Thanks a lot,
Stan
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org