Re: [Numpy-discussion] question about array slicing and element assignment

2018-06-19 Thread Stephan Hoyer
You will need to convert "a[(2,3,5),][mask]" into a single indexing expression, e.g, by using utility functions like np.nonzero() on mask. NumPy can't support assignment in chained indexing. On Tue, Jun 19, 2018 at 1:25 PM Emil Sidky wrote: > Hello, > The following is an example where an array

[Numpy-discussion] question about array slicing and element assignment

2018-06-19 Thread Emil Sidky
Hello, The following is an example where an array element assignment didn't work as I expected. Create a 6 x 3 matrix: In [70]: a =  randn(6,3) In [71]: a Out[71]: array([[ 1.73266816,  0.948849  ,  0.69188222],    [-0.61840161, -0.03449826,  0.15032552],    [ 0.4963306 ,  0.77028209,