I have a list in the following format which i want to sort by date. I tried to convert the date-string into datetime-objects but it always says that it doesnt match the format. liste = [['25.03.19', 41, 129], ['19.03.19', 47, 95], ...]* error: ValueError: time data '' does not match format '%d.%m.%y'
def go(path):
liste = []
for data in (os.listdir(path)):
datei = path + "/" + data
datenliste = data_as_list(datei)
liste.append(stats(datenliste))
print(liste)*
liste.sort(key=lambda date: datetime.datetime.strptime(date[0], '%d.%m.%y'))
The stats() funktion brings the datenliste in the special format [date, integer, integer]