dtypechar error in stats.norm.fit (Trac #43) #570
Labels
defect
A clear bug or issue that prevents SciPy from being installed or used as expected
Migrated from Trac
scipy.optimize
Original ticket http://projects.scipy.org/scipy/ticket/43 on 2006-03-24 by trac user novin01 AT gmail.com, assigned to unknown.
Changing to .dtype.char fixes the problem, but I thought I'd post anyway.
This was on a P4/WinXP box with
python-2.4.2
numpy-0.9.4.win32-py2.4
scipy-0.4.4.win32-py2.4-P4SSE2
The following code replicates the error:
In [1]: from scipy import *
In [2]: x = stats.norm.rvs(size=1000,loc=0,scale=1)
In [3]: mu, sigma = stats.norm.fit(x)
exceptions.AttributeError Traceback (most recent call last)
\W2K4670\D$\GAS\Data\Processes
C:\Python24\lib\site-packages\scipy\stats\distributions.py in fit(self, data, _args, *_kwds)
726 # location and scale are at the end
727 x0 = args + (loc0, scale0)
--> 728 return optimize.fmin(self.nnlf,x0,args=(ravel(data),),disp=0)
729
730 def est_loc_scale(self, data, *args):
C:\Python24\lib\site-packages\scipy\optimize\optimize.py in fmin(func, x0, args, xtol, ftol, maxiter, maxfun, full_output, disp, retall)
189 sim = Num.zeros((N+1,),x0.dtypechar)
190 else:
--> 191 sim = Num.zeros((N+1,N),x0.dtypechar)
192 fsim = Num.zeros((N+1,),'d')
193 sim[0] = x0
AttributeError: 'numpy.ndarray' object has no attribute 'dtypechar'
In [4]:
The text was updated successfully, but these errors were encountered: