How do I add 0's to the beginning and end of each row of a multidimensional array? This is the function I am trying to apply to each row.
def zero(ltr):
for x in range (1,int((N+1)/2)):
ltr = append(([0]), ltr)
ltr = append(ltr,([0]))
return ltr
I have tried using both
for row in a:
zero(row)
and
apply_along_axis(zero,1,a)
Neither one of these commands does what I want.