Jan-22-2021, 04:37 PM
So simple question, I could make it work in a lambda probably but my experience is limited and I suspect there may already be a built in to do what I need. I have some data that I currently sort using sort like so
data.sort(order=['bin','ref'])
I'm not the one who uses the data, so i am only just finding out it only really works 80% of the time. 'bin' is always an integer, so the sort works great, and that's the critical value. sorting by ref is where it breaks down, as 'ref' is alphanumeric which leaves us to a bad order. ref values are of the format 'A1', 'A4', 'A13', which means when sorted 'A13' comes before 'A4', which is not the desired behavior. is there a built in sort option to do a windows style alphabetic sort, instead of a linux style? or do i need to manually mangle the string and split and sort it that way?
I always prefer to use a built in w/ options than roll my own, because one will always be less buggy than the other, and it's not my code lol
data.sort(order=['bin','ref'])
I'm not the one who uses the data, so i am only just finding out it only really works 80% of the time. 'bin' is always an integer, so the sort works great, and that's the critical value. sorting by ref is where it breaks down, as 'ref' is alphanumeric which leaves us to a bad order. ref values are of the format 'A1', 'A4', 'A13', which means when sorted 'A13' comes before 'A4', which is not the desired behavior. is there a built in sort option to do a windows style alphabetic sort, instead of a linux style? or do i need to manually mangle the string and split and sort it that way?
I always prefer to use a built in w/ options than roll my own, because one will always be less buggy than the other, and it's not my code lol