Sep-13-2020, 10:14 AM
I am having trouble getting sort to work.
Here is the code
(0, 3)
(1, 10)
(2, 8)
(3, 12)
(4, 2)
(5, 1)
(6, 4)
(7, 8)
(8, 10)
(9, 1)
(10, 1)
(11, 6)
(12, 10)
(13, 4)
(14, 3)
(15, 5)
(16, 2)
(17, 12)
(18, 4)
(19, 4)
(20, 10)
(21, 6)
(22, 12)
(23, 6)
(24, 3)
(25, 15)
(26, 2)
(27, 5)
(28, 4)
(29, 2)
(30, 10)
(31, 2)
(32, 20)
(33, 6)
(34, 3)
(35, 3)
(36, 4)
(37, 12)
(38, 6)
(39, 4)
(40, 10)
(41, 10)
(42, 4)
(43, 6)
(44, 3)
(45, 30)
(46, 10)
(47, 12)
(48, 3)
(49, 8)
(50, 6)
(51, 4)
(52, 10)
(53, 6)
(54, 30)
(55, 5)
(56, 6)
(57, 10)
(58, 10)
(59, 20)
(60, 8)
(61, 6)
(62, 15)
(63, 12)
Thank you.
Here is the code
def load_track_to_Handi(): my_tracklabel= Label(root, text =" ", fg= "#F50808", font = ("sans_serif" , 16)).place(x=380, y=430) read_csvfile_into_array() global track_abrev global race_number #if fileFound ==True: x=[] xx = [] hcount = 0 with open( 'C://guis/f_racefiles/'+ track_abrev + '.csv' , 'r') as race_file: #csv_reader = csv.reader(race_file) #for line in race_file: #print(line) df = pd.read_csv(race_file, header =None) for i in df: x= np.array(df.iloc[hcount, 17:18]) xx = (hcount,int(x)) #print (xx) hcount+=1 print(xx) np.sort(x, axis=1)Here is what I get. I want to sort the 2nd column....
(0, 3)
(1, 10)
(2, 8)
(3, 12)
(4, 2)
(5, 1)
(6, 4)
(7, 8)
(8, 10)
(9, 1)
(10, 1)
(11, 6)
(12, 10)
(13, 4)
(14, 3)
(15, 5)
(16, 2)
(17, 12)
(18, 4)
(19, 4)
(20, 10)
(21, 6)
(22, 12)
(23, 6)
(24, 3)
(25, 15)
(26, 2)
(27, 5)
(28, 4)
(29, 2)
(30, 10)
(31, 2)
(32, 20)
(33, 6)
(34, 3)
(35, 3)
(36, 4)
(37, 12)
(38, 6)
(39, 4)
(40, 10)
(41, 10)
(42, 4)
(43, 6)
(44, 3)
(45, 30)
(46, 10)
(47, 12)
(48, 3)
(49, 8)
(50, 6)
(51, 4)
(52, 10)
(53, 6)
(54, 30)
(55, 5)
(56, 6)
(57, 10)
(58, 10)
(59, 20)
(60, 8)
(61, 6)
(62, 15)
(63, 12)
Thank you.