Skip to content

Commit b4b9717

Browse files
committed
step_func
1 parent 7345667 commit b4b9717

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

step_function.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import numpy as np
2+
3+
def step_function(x):
4+
y = x > 0
5+
print(y)
6+
return y.astype(np.int)
7+
8+
res = step_function(np.array([0,1,3]))
9+
print(res)

0 commit comments

Comments
 (0)