I wonder if it would be possible, when in python mode: "%python", Sage would revert to use standard python (and numpy) types.
I can now replicate my previous bug report with just a line of python (excluding the import): %python from scipy import stats stats.randint(0,23).ppf(3) I don't see why sage types should get in the way here, since we are only dealing with integers and in "python mode" (what is this supposed to mean if not a pure python code block?) Flávio On 9 abr, 11:45, Robert Bradshaw <rober...@math.washington.edu> wrote: > On Apr 9, 2009, at 3:34 AM,FlavioCoelhowrote: > > > Hi I having trouble with running code within sage which runs perfectly > > in straight Python: > > ... > > > TypeError: array cannot be safely cast to required type > > > can anyone tell me if this is a Sage "bug" or "feature" ;-) > > My guess is that it's a NumPy bug--NumPy doesn't play well with Sage > types (including floating point numbers). One reason we do this is so > that > > sage: 1/3 > > actually gives the rational number 1/3, rather than 0 (or some > floating point approximation). Sage code is run through a preparser > that wraps literals in Sage types. > > - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---