0

I have a matrix with dimension (100,500,500) and would like to pad along axis 1 and 2, but not along axis 0. Is there a way to do that in numpy or do I have to split the matrix and stack it again?

Numpy.pad does not have a keyword axis.

cerv21
  • 311
  • 1
  • 2
  • 11
  • 2
    Take a look at the docs for [np.pad](https://numpy.org/doc/stable/reference/generated/numpy.pad.html), specifically the `pad_width` argument. You need something like `pad_width=((0, 0), (a, b), (c, d))` in your case. – Mercury Dec 01 '22 at 19:16

0 Answers0