Python Forum
Sorting list from FTP by Date
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sorting list from FTP by Date
#3
Hi Lastile,
I think you are missing one important detail. You say you have 3 lists. And you want to keep the data together after sorting. This is very difficult.
Instead you should make one list. Each element of this list must also be a list (or tuple or dictionary ...). Each of these nested lists must contain the three elements filesize,modify and filename. So "yourlist[0][0]" would contain the filesize of the first file. And "yourlist[0][2]" the filename etc. Then you can use the sort() or sorted() function with the key= argument as Gribouillis suggested.
Reply


Messages In This Thread
Sorting list from FTP by Date - by lastyle - Oct-28-2021, 10:10 PM
RE: Sorting list from FTP by Date - by Gribouillis - Nov-01-2021, 09:59 PM
RE: Sorting list from FTP by Date - by ibreeden - Nov-02-2021, 05:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  replace nan values by mean group by date.year, date.month wissam1974 5 10,537 Feb-19-2020, 06:25 PM
Last Post: AnkitGupta
  Finding date count from a list of date range in pandas trillerducas72 0 3,252 May-24-2018, 02:30 AM
Last Post: trillerducas72

Forum Jump:

User Panel Messages

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