I have a variable with an array made up of datetimes I've pulled from a CSV file, that looks something like this.
[datetime.date(2020, 9, 2), datetime.date(2020, 9, 2), datetime.date(2020, 10, 2), datetime.date(2020, 10, 2), datetime.date(2020, 10, 2), datetime.date(2020, 10, 2), datetime.date(2020, 11, 2), ..., datetime.date(2020, 10, 28)]
And I have variable with an array also pulled from the CSV file with temperatures as floats, of similar length.
[24.9, 23.4, 23.8, 22.9, 23.6, ..., 25.2]
I'm looking for a way to sort both of these arrays so the temperature value corresponding to the date value, have the same position in new arrays. The new arrays should be sorted so that the date arrays only includes the same date, so it can be used for making multiple boxplots with the temperature from each day. For example:
[datetime.date(2020, 9, 2), datetime.date(2020, 9, 2)]
[datetime.date(2020, 10, 2), datetime.date(2020, 10, 2), datetime.date(2020, 10, 2)]
...
and
[24.9, 23.4]
[23.8, 22.9, 23.6]
...
I guess there's some way to do it with for loops, but I have no idea how.
P.S. it's not going to be the same dataset each time the program is run, and each dataset contains 8000 entries.