data-science-complete-tutorial icon indicating copy to clipboard operation
data-science-complete-tutorial copied to clipboard

Some mistakes in 1. Notebook

Open morosow opened this issue 6 years ago • 0 comments

  1. In 1.4.2 Experiment : Change the value of matrices by Reference adding 10 to elements with even indices is wrong:

Add 10 to all the even indexes in matrix mat = np.array([[1,2,3],[4,5,6],[7,8,9]]) mat1 = mat[::2,::2] mat1 += 10

Nice, but it reduces matrix dimension from 3x3 to 2x2

  1. Please, check 1.3.7 Horizontal Matrix splitting :

mat = np.random.randint(0,6,(3,7)) sp1,sp2,sp3 = np.hsplit(mat,[4,6]) print ('Original matrix of shape %s, is \n%s\n'%(mat.shape,mat)) print ('First split of shape %s, is \n%s\n'%(sp1.shape,sp1)) print ('Second split of shape %s, is \n%s\n'%(sp2.shape,sp2)) print ('Third split of shape %s, is \n%s\n'%(sp3.shape,sp3))

Are you sure, that it must be always split on [4,6] indices? If yes, would be better to explain these actions, because it's difficult to understand.

morosow avatar Nov 17 '19 22:11 morosow