![](https://secure.gravatar.com/avatar/6a1dc50b8d79fe3b9a5e9f5d8a118901.jpg?s=120&d=mm&r=g)
April 24, 2008
5:16 p.m.
On Thu, Apr 24, 2008 at 10:01 AM, Rich Shepard <rshepard@appl-ecosys.com> 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))