Hello,

Anybody has any suggestions as how to figure a solutions for the
problem below?

In trying to call functions in scipy.stats where it calls
scipy.special functions, I get the error seen below.  There are no
problems calling these functions from !python.
I assume that within sage, there is a problem coercing sage objects
into python types for these special functions. And since the betainc
function is called from  another scipy module, I can't explicitly
declare the variable types.

Any suggestions?

Thanks

Shahab


sage: from scipy import stats
sage: stats.ttest_ind(list([1,2,3,4,5]),list([2,3,4,5,.6]))
---------------------------------------------------------------------------
<type 'exceptions.TypeError'>             Traceback (most recent call
last)

/home/jars/Desktop/sage/<ipython console> in <module>()

/home/jars/Desktop/sage/local/lib/python2.5/site-packages/scipy/stats/
stats.py in ttest_ind(a, b, axis)
   1706     t = (x1-x2)/np.sqrt(svar*(1.0/n1 + 1.0/n2))  # N-D
COMPUTATION HERE!!!!!!
   1707     t = np.where(zerodivproblem, 1.0, t)           # replace
NaN t-values with 1.0
-> 1708     probs = betai(0.5*df,0.5,float(df)/(df+t*t))
   1709
   1710     if not np.isscalar(t):

/home/jars/Desktop/sage/local/lib/python2.5/site-packages/scipy/stats/
stats.py in betai(a, b, x)
   2014     x = np.asarray(x)
   2015     x = np.where(x < 1.0, x, 1.0)  # if x > 1 then return 1.0
-> 2016     return special.betainc(a, b, x)
   2017
   2018 #####################################

<type 'exceptions.TypeError'>: function not supported for these types,
and can't coerce safely to supported types
sage:

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to