Can someone explain the codes for these two situations? Any help much appreciated. I’m using a spyder anaconda console if that helps
In : import numpy as np In : x = (20*np.random.rand(5, 7))//2
Enter an expression which sets columns 1, 3, and 4 to 1.5. Use advanced indexing combined with slicing for this.
In : import numpy as np In : x = np.zeros((5, 3)) In : col = np.arange(5.0) ``
Enter an expression which adds col to column 1 of x.