We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I think
print(np.sort(Z)[-n:])
or
Z.sort() print(Z[-n:])
would be better than
numpy-100/100_Numpy_exercises_with_hints_with_solutions.md
Line 1084 in 916e1ec
because the first solution is simpler, and if it's ok to modify the array in place, the second solution is faster and uses less space.
The text was updated successfully, but these errors were encountered:
It is written that argsort is the slow solution and Z[np.argpartition(-Z,n)[:n]] is faster because of partial ordering.
Z[np.argpartition(-Z,n)[:n]]
Sorry, something went wrong.
I read that, but either of the solutions I wrote would be a better slow solution, right?
No branches or pull requests
I think
or
would be better than
numpy-100/100_Numpy_exercises_with_hints_with_solutions.md
Line 1084 in 916e1ec
because the first solution is simpler, and if it's ok to modify the array in place, the second solution is faster and uses less space.
The text was updated successfully, but these errors were encountered: