np ma filled

Solutions on MaxInterview for np ma filled by the best coders in the world

showing results for - "np ma filled"
Elsa
27 Oct 2016
1>>> x = np.ma.array(np.arange(9).reshape(3, 3), mask=[[1, 0, 0],
2                                                      [1, 0, 0],
3                                                      [0, 0, 0]])
4
5>>> x.filled(123) 
6array([[123,   1,   2],
7       [123,   4,   5],
8       [  6,   7,   8]])
similar questions
queries leading to this page
np ma filled