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

alternative solution for Q.83 & Q.84 #156

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

alternative solution for Q.83 & Q.84 #156

wants to merge 2 commits into from

Conversation

iamyifan
Copy link
Contributor

@iamyifan iamyifan commented Jul 27, 2021

Q.83: The np.bincount only counts non-negative ints according to its docs, which is not very useful in the dirty dataset. It can be optimized with np.unique(data, return_counts=True), which returns the unique values and corresponding count.

Q.84: sliding_window_view is a more readable function.

@iamyifan iamyifan changed the title alternative solution for Q.83 alternative solution for Q.83 & Q.84 Aug 2, 2021
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 this pull request may close these issues.

1 participant