Skip to content

I have a better way to solve exercise 89 #217

Description

@anthonyduong9

I think

print(np.sort(Z)[-n:])

or

Z.sort()
print(Z[-n:])

would be better than

print (Z[np.argsort(Z)[-n:]])

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions