I have a complex array; every element has subelements and every subelement has sub-subelements. My array is;
myComplex=[[['03.04.2019', 'Jack', '7']], [['26.03.2019', 'Micheal', '5'], ['26.03.2019', 'Smith', '8']], [['01.04.2019', 'Jack', '11'], ['01.04.2019', 'Michelle', '2'], ['01.04.2019', 'George', '9']]]
Let me explain this array;
The Subelement that begins with '03.04.2019'; ['03.04.2019', 'Jack', '7']
The Subelement that begins with '26.03.2019'; ['26.03.2019', 'Micheal', '8']
, ['26.03.2019', 'Smith', '5']
The Subelement that begins with '01.04.2019'; ['01.04.2019', 'Jack', '11']
, ['01.04.2019', 'Michelle', '2']
, ['01.04.2019', 'George', '9']
In myComplex
above, as you see, every subelements' first sub-subelement is a date. I want to order these subelements with their dates. So I want the output like this when I enter print(myComplex)
;
[[['26.03.2019', 'Micheal', '5'], ['26.03.2019', 'Smith', '8']], [['01.04.2019', 'Jack', '11'], ['01.04.2019', 'Michelle', '2'], ['01.04.2019', 'George', '9']], [['03.04.2019', 'Jack', '7']]]
How can I do that? Can you give me a solution for this? I asked a similar question in here but now I have more complex array.