I still don't understand why the solution you propose in the wiki is necessary.... Unless sage is passing (to the ppf function) something other than standard python's ints and floats. Is this the case?
I just tested the same code snippet in a %python cell (in a notebook) and it works as expected ( without the int()s and float()s). However, when I try to run it the same code in a module that is imported (in a %python cell) I get the error. I didn't expect that. I think that any code that runs in straight python should run on %python blocks, even imported code. I tried to run the same module via load instead of import, but load was trying to load from the ~/.sage directory instead of the directory where I started sage, (is this a bug?). Also load also gave me a syntax error when gave it a path : "load somedir/test.py". Shouldn't load take full paths instead of only filenames? Flávio On 22 abr, 15:55, William Stein <wst...@gmail.com> wrote: > On Wed, Apr 22, 2009 at 7:19 AM, Flavio Coelho <fccoe...@gmail.com> wrote: > > > Hi > > > anyone know why this simple python code fails in sage? > > > from scipy import stats > > stats.uniform(0,15).ppf([0.5,0.7]) > > > This has been a show stopper for me as need to do statistics... > > This questions was answered incorrectly (and hard to find) in the SAGE > Faq, so I've put in a correct answer. See: > > http://wiki.sagemath.org/faq#Typeissuesusingscipy.2Ccvxoptornumpyfrom... > > William --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---