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

>>> dpolya1(1,2,0.5,0.4)
-5.9741312822170585
>>> type(dpolya1(1,2,0.5,0.4))
<type 'float64scalar'>
>>> exp(dpolya1(1,2,0.5,0.4))
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: 'numpy.ndarray' object has no attribute 'exp'

I do not understand what's wrong. Any help?
Thanks
Angelo


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to