如何编写仅在4x5矩阵中选择圆的函数
. . . . .
. o o o .
. o o o .
. . . . .
import numpy as np
def list_3(arr):
return
下面的代码用于测试 如果它没有给出任何错误,则代码有效
def list_3_test():
arr = np.array([[ 1.,2.,3.,4.,5.],[ 0.,1.,4.],[-1.,0.,3.],[-2.,-1.,2.]])
correct = np.array([[1.,[0.,2.]])
your_solution = list_3 (arr)
assert np.array_equal(your_solution,correct)
list_3_test()