sort np list of string 1

sort np list of string

arr = ['01','05','08','06','10','02','04']
sorted_arr = np.sort(arr)
print(sorted_arr)
>> array(['01', '02', '04', '05', '06', '08', '10'])

Here is what the above code is Doing:
1. We create an array of strings.
2. We sort the array using the np.sort() function.
3. We print the sorted array.

Similar Posts