I have array elements of the form:
['A 0', 'A 10', 'A 1', 'A 100', 'A 20', 'A 200']
When I try to sort it with np.sort(), it does not sort properly. How to sort the array properly?
Code
import numpy as np
A = np.array(['A 0', 'A 10', 'A 1', 'A 100', 'A 20', 'A 200'])
A = np.sort(A)
print A
Output
['A 0' 'A 1' 'A 10' 'A 100' 'A 20' 'A 200']
Desired output
['A 0' 'A 1' 'A 10' 'A 20' 'A 100' 'A 200']