Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some mistakes in 1. Notebook #7

Open
morosow opened this issue Nov 17, 2019 · 0 comments
Open

Some mistakes in 1. Notebook #7

morosow opened this issue Nov 17, 2019 · 0 comments

Comments

@morosow
Copy link

morosow commented Nov 17, 2019

  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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant