I'm working on Python 3.4, I have 2 lists:
lista_1 = ['2017-10-01', '2017-10-02', '2017-10-03', '20107-10-04'] # Fechas de un periodo
lista_2 = [['20107-10-01', campo2, campo3], ['2017-10-03', campo2, campo3], ['2017-10-04', campo2, campo3]] #Datos a analizar
I want to compare the two lists to see if the first data (date) of each sublist of the lista_2
is within the lista_1
.
If not found in lista_2
, a sublist with the missing date and field 2 and field 3 must be added to lista_2
as an empty string; at the end sort the lista_2
by date from the oldest to the most recent.
Fecha
is a DateTime
object in both lists.