I have a list of lists, each with four items. For each list within it, I want to take indexes 0 and 2, put them in a list, then put all those lists in one list of lists. So, using for loops, I got what I wanted by doing this:
finallist =  for i in range(len(weather_data)): templist =  templist.append(weather_data[i]) templist.append(weather_data[i]) finallist.append(templist)
so that gets me a list like [['2018-02-01', -18.6], ['2018-02-02', -19.6], ['2018-02-03', -22.3]]. But for this assignment, I'm supposed to do that by using one list comprehension. Best I can get is this:
weekendtemps = [x for x in weather_data if (x == "Saturday" or x == "Sunday")]
But that only gives me [['2018-02-01'], ['2018-02-2'], ['2018-02-03']]. How do I get both weather_data and weather_data using list comprehension?