Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import *
- from math import *
- from pylab import *
- import numpy as np
- def exp_pdf(x,d,l):
- if x <= d:
- return 0
- else:
- return l * exp( - l * (x-d) )
- def main():
- start = 0
- end = 20
- points = 1000
- X = np.linspace(start,end,points,endpoint=True)
- Y = exp_pdf(X,0,1)
- plot(X,Y)
- show()
- main()
- Traceback (most recent call last):
- File "tests.py", line 34, in <module>
- main()
- File "tests.py", line 26, in main
- Y = exp_pdf(X,0,1)
- File "tests.py", line 9, in exp_pdf
- if x <= d:
- ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement