Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dtypechar error in stats.norm.fit (Trac #43) #570

Closed
scipy-gitbot opened this issue Apr 25, 2013 · 0 comments
Closed

dtypechar error in stats.norm.fit (Trac #43) #570

scipy-gitbot opened this issue Apr 25, 2013 · 0 comments
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected Migrated from Trac scipy.optimize

Comments

@scipy-gitbot
Copy link

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]:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected Migrated from Trac scipy.optimize
Projects
None yet
Development

No branches or pull requests

1 participant