np pad

Solutions on MaxInterview for np pad by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "np pad"
Addie
02 Jul 2017
1>>> np.pad(a, [(1, ), (2, )], mode='constant')
2array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
3       [ 0.,  0.,  1.,  1.,  1.,  1.,  1.,  0.,  0.],
4       [ 0.,  0.,  1.,  1.,  1.,  1.,  1.,  0.,  0.],
5       [ 0.,  0.,  1.,  1.,  1.,  1.,  1.,  0.,  0.],
6       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.]])