You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

406 B

1.1 用0填充数组边界

(1). 解题思路

numpy库中提供了一个名为pad的方法可以用来填充数组的边界其提供的功能非常多可以指定上下左右边界的宽度并且可以填充为最小值、平均值、常值等等。这个题目只需把上下左右的边界宽度置为1且用0填充即可。

(2). 运行结果