>>> from numpy import *
>>>
>>> A = array([[1,2,3], [4,5,6], [7,8,9]])
>>>
>>> def somefunc(x):
... x1 = x
... x2 = x - 3
... return where(x < 7, x1, x2)
...
>>> somefunc(A)
array([[1, 2, 3],
[4, 5, 6],
[4, 5, 6]])
>>>
100
No comments:
Post a Comment