0

im having a problem to convert post in matlab padarray to pad function in python, i want to do the same in python pad function :

padded=np.pad(MAT,(1,1),'post');

this is not working because there is no post function in python

this is an example in matlab (i want to do the same in python pad function):

enter image description here

it will really help me , thank you

shlezz
  • 91
  • 11

1 Answers1

1
a=np.array([[1,3,4]])
b=np.pad(a,((0,1),(0,0)),'constant')

Notice that a should be a two dimensional array. If this is confusing, read the documentation: https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.pad.html

anishtain4
  • 2,342
  • 2
  • 17
  • 21
  • ok great , i have just fixed it to : b=np.pad(a,((0,1),(0,1)),'constant') and its working well thank you ! – shlezz Jan 17 '18 at 23:20