![](https://secure.gravatar.com/avatar/849a8a407206108de2d4f208492c02bd.jpg?s=120&d=mm&r=g)
Hi, I have the following script import fileinput import string from math import * from scipy import * from rpy import * import Numeric import shelve import sys def dpolya1(n,N,b,a): a=float(a) b=float(b) L=784 probs=((special.gammaln(N+1)+special.gammaln(L*(a/b))+special.gammaln((a/b)+n)+special.gammaln((a/b)*(L-1)+N-n))-(special.gammaln(L*(a/b)+N)+special.gammaln(a/b)+special.gammaln(n+1)+special.gammaln(N-n+1)+special.gammaln(L*(a/b)-(a/b))))#) return probs and I observe the following "strange" (for me of course) behaviour
I do not understand what's wrong. Any help? Thanks Angelo
![](https://secure.gravatar.com/avatar/764323a14e554c97ab74177e0bce51d4.jpg?s=120&d=mm&r=g)
Angelo Secchi wrote:
Probably rpy (which still uses Numeric, right?) is exposing Numeric's exp() implementation and overriding the one that you got from scipy (which is numpy's, I presume). When Numeric's exp() is confronted with an object that it doesn't recognize, it looks for a .exp() method to call. If you want to avoid this situation in the future, don't use the "from foo import *" form. It makes debugging problems like this difficult. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
![](https://secure.gravatar.com/avatar/764323a14e554c97ab74177e0bce51d4.jpg?s=120&d=mm&r=g)
Angelo Secchi wrote:
Probably rpy (which still uses Numeric, right?) is exposing Numeric's exp() implementation and overriding the one that you got from scipy (which is numpy's, I presume). When Numeric's exp() is confronted with an object that it doesn't recognize, it looks for a .exp() method to call. If you want to avoid this situation in the future, don't use the "from foo import *" form. It makes debugging problems like this difficult. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
participants (2)
-
Angelo Secchi
-
Robert Kern