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

Add speed comparison for broadcasting exercise in NumPy lecture #230

Closed
natashawatkins opened this issue Sep 30, 2022 · 1 comment · Fixed by #235
Closed

Add speed comparison for broadcasting exercise in NumPy lecture #230

natashawatkins opened this issue Sep 30, 2022 · 1 comment · Fixed by #235
Assignees

Comments

@natashawatkins
Copy link
Member

I saw that there was a new exercise in the NumPy lecture (Exercise 9.4), but I thought maybe it would be more useful for illustrating broadcasting if the reader is asked to use compare the speeds of broadcasting vs. using the for-loop they write.

@jstac
Copy link
Contributor

jstac commented Sep 30, 2022

Good point @natashawatkins .

@HumphreyYang , how about

  • adding np.random.seed(123) here so the output is the same for all readers
  • adding a second part to the exercise where 4 is replaced by a large number and the reader is asked to time a for loop against the broadcast implementation.

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

Successfully merging a pull request may close this issue.

3 participants