I have a 2D numpy array called adj=dim(16,16)
. l would like to pad it with zeros to get new_adj=dim(31,31)
.
I tried...
new_adj=np.pad(adj,((15,31),(31,15)),mode='constant')
However
new_adj.shape=(62, 62)
I'm supposed to get...
new_adj.shape=(31, 31)