[Numpy-discussion] New numpy functions: filled, filled_like

Alan G Isaac alan.isaac@gmail....
Mon Jan 14 13:17:51 CST 2013


Thanks Pierre for noting that np.tile already
provides a chunk of this functionality:

 >>> a = np.tile(5,(1,2,3))
 >>> a
array([[[5, 5, 5],
         [5, 5, 5]]])
 >>> np.tile(1,a.shape)
array([[[1, 1, 1],
         [1, 1, 1]]])

I had not realized a scalar first argument was possible.

Alan Isaac


More information about the NumPy-Discussion mailing list