I am trying to sort a numpy array using this very simple code:
print np.array([2,0,8,4,1]).sort()
However, I am getting the result:
None
Can someone tell me what’s going on here?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The array probably gets sorted in-place, like Python’s
list.sort()does so you don’t get fooled into thinking the original array is still the same.