Issue
I am using the code shown below but doesn't work...
For example, I want to put
X=[2,2,2]
then
S(X)=sum([4,4,4]+[1,1,1])=15
S=lamda X:sum(X**2+np.ones(3))
S(2*np.ones(3))
Solution
You should replace lamda
with lambda
.
X=[2,2,2]
S=lambda X:sum(X**2+np.ones(3))
print S(2*np.ones(3))
Output:
15.0
I edited your question because I thought it was a typo but the change was rejected. I agree that the typo is the only problem so I am submitting this as an answer.
Answered By - Juan Leni
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.