What is the sorting order of characters in Python (or numpy)? is there any table?
[In] : np.sort(["a","c","b","-"])
[Out]: array(['-', 'a', 'b', 'c'],
dtype='|S1')
[In] : np.sort(["a","c","b","78"])
[Out]: array(['78', 'a', 'b', 'c'],
dtype='|S1')
Is there anything which would sort after the letters? Or, alternately, how is this order decided? I tried a lot of special characters, they all sort in the front.
sorted()
behaves the same way.
~,{,|,}characters and thedelspecial character are the only characters that come after letters in the ASCII table.