Python Forum
sorting alphanumeric values in a human way
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sorting alphanumeric values in a human way
#4
oh sorry! I confused myself, it is a numpy array (a named array i guess) so I am sorting it by the two named columns. I often use terms incorrectly with these arrays so hopefully I am using it correctly here. the entirety of my sort code is as I said above:
def sort_by_column(data, order=['bin','ref']):
    '''sort data in place based on order list'''

    data.sort(order=order)
'bin' is an actual integer and it sorts it fine by that, it's the second ranking that is sorting, but not sorting the way i want. Does that clarify?


https://numpy.org/doc/stable/reference/g....sort.html
Reply


Messages In This Thread
RE: sorting alphanumeric values in a human way - by idiotonboarding - Jan-22-2021, 05:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Human Sorting (natsort) does not work [SOLVED] AlphaInc 2 1,167 Jul-04-2022, 10:21 AM
Last Post: AlphaInc
  Sorting numerical values provided by QAbstractTableModel BigMan 0 1,385 Jun-04-2022, 12:32 AM
Last Post: BigMan
  List sort - alphanumeric? papsphilip 2 2,494 Oct-05-2019, 09:27 PM
Last Post: papsphilip
  Sorting a copied list is also sorting the original list ? SN_YAZER 3 3,109 Apr-11-2019, 05:10 PM
Last Post: SN_YAZER
  How to convert Python crawled Bing web page content to human readable? dalaludidu 4 3,457 Sep-02-2018, 04:15 PM
Last Post: dalaludidu
  Batch job from epoch to human time jheeman 6 4,563 Feb-27-2018, 10:53 PM
Last Post: jheeman
  Time Difference in Epoch Microseconds then convert to human readable firesh 4 11,666 Feb-27-2018, 09:08 AM
Last Post: firesh
  Sorting values calculated in python stumunro 4 3,995 Sep-13-2017, 06:09 AM
Last Post: nilamo
  sorting nested dict according to values merlem 6 17,663 Apr-01-2017, 10:01 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020