Writting in sub-ndarray of a ndarray in the most pythonian way. Python 2
I have a ndarray like this one: number_of_rows = 3 number_of_columns = 3 a = np.arange(number_of_rows*number_of_columns).reshape(number_of_rows,number_of_columns) a array([[0, 1, 2], [3, 4, 5], [6, 7, 8]]) But I want something like this: array([[0, 100, 101], [3, 102, 103], [6, 7, 8]]) To do that I want to avoid to do it one by one, I rather prefer to do it in arrays or matrices, because later I want to extend the code. Nothe I have change a submatrix of the initial matrix (in mathematical terms, in terms of this example ndarray). In the example the columns considered are [1,2] and the rows [0