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.

13 lines
406 B

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 1.1 用0填充数组边界
## (1). 解题思路
`numpy`库中提供了一个名为`pad`的方法可以用来填充数组的边界其提供的功能非常多可以指定上下左右边界的宽度并且可以填充为最小值、平均值、常值等等。这个题目只需把上下左右的边界宽度置为1且用0填充即可。
## (2). 运行结果
![](images/result.png)