Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble with Sort
#5
I will do more research. Thank you.

XX is a two dimension array. i column and 63 rows. I used this code and it threw an error. Which is posted under the code.
unsorted_list = xx
	sorted_list = sorted(unsorted_list, key=lambda x:x[0])
	print(sorted_list)	
Error.....

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\Milford\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
return self.func(*args)
File "testloop.py", line 126, in select_track
load_track_to_Handi()
File "testloop.py", line 94, in load_track_to_Handi
xx= np.array(df.iloc[hcount, 18:19 ])
File "C:\Users\Milford\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\core\indexing.py", line 873, in __getitem__
return self._getitem_tuple(key)
File "C:\Users\Milford\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\core\indexing.py", line 1443, in _getitem_tuple
self._has_valid_tuple(tup)
File "C:\Users\Milford\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\core\indexing.py", line 702, in _has_valid_tuple
self._validate_key(k, i)
File "C:\Users\Milford\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\core\indexing.py", line 1352, in _validate_key
self._validate_integer(key, axis)
File "C:\Users\Milford\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\core\indexing.py", line 1437, in _validate_integer
raise IndexError("single positional indexer is out-of-bounds")
IndexError: single positional indexer is out-of-bounds

I don't understand what this all means.
Reply


Messages In This Thread
Trouble with Sort - by Milfredo - Sep-13-2020, 10:14 AM
RE: Trouble with Sort - by Askic - Sep-13-2020, 10:51 AM
RE: Trouble with Sort - by Milfredo - Sep-13-2020, 06:50 PM
RE: Trouble with Sort - by scidam - Sep-14-2020, 12:44 AM
RE: Trouble with Sort - by Milfredo - Sep-14-2020, 04:12 AM
RE: Trouble with Sort - by Askic - Sep-14-2020, 05:50 AM
RE: Trouble with Sort - by Milfredo - Sep-14-2020, 06:56 AM
RE: Trouble with Sort - by Askic - Sep-14-2020, 02:21 PM
RE: Trouble with Sort - by Milfredo - Sep-14-2020, 02:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Photo a.sort() == b.sort() all the time 3lnyn0 1 1,325 Apr-19-2022, 06:50 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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