health-data-science-OR / coding-for-ml

Learning materials for Coding for Machine Learning and Data Science
https://www.pythonhealthdatascience.com
MIT License
15 stars 4 forks source link

Issue on page /content/01_algorithms/03_numpy/03_slicing.html #26

Closed TomMonks closed 2 years ago

TomMonks commented 2 years ago

Fancy indexing

The print statement refers to sliced_matrix, but should refer to sub_matrix. This results in an exception.

i.e.

complete_matrix = np.arange(9).reshape(-1, 3)

row = [0, 1, 2]
col = [2, 1, 2]

sub_matrix = complete_matrix[row, col] 

print(f'original matrix: \n{complete_matrix}')
print(f'sub matrix: \n{sub_matrix}')
TomMonks commented 2 years ago

Fixed in Dev.

TomMonks commented 2 years ago

Now live at pythonhealthdatascience.com