On Thu, Apr 24, 2008 at 10:01 AM, Rich Shepard <[EMAIL PROTECTED]> wrote: > In the application's function I now have: > > from numpy import * > > x = nx.arange(0, 100, 0.1) > y = nx.normal(center,width) # passed to the function when called > > and I then pass x,y to PyX for plotting. But python responds with: > > y = nx.normal(center,width) > AttributeError: 'module' object has no attribute 'normal'
It's random.normal(loc, scale). But that will give you random x values drawn from the normal distribution, not y values at your x. So you'll have to code your own normal, which will probably look something like norm = 1 / (scale * sqrt(2 * pi)) y = norm * exp(-power((x - loc), 2) / (2 * scale**2)) _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
