The list signals_by_date stores tuples and each tuple contains 15 numbers. For each tuple within signals_by_date, I want to remove numbers that don’t satisfy certain criteria. For some reason, no matter what constraints I put in the list comprehension, I’m always left with 7 numbers in each tuple. In the code example below, all numbers are less than 3, so I would expect each tuple to be empty. What am I doing wrong? Many thanks.
signals_by_date = []
for i in range(0, 1):
temp_signals = []
for symbol in symbols:
for signal in signals_by_symbol[symbol]:
temp_signals.append(signal[i]-1)
signals_by_date.append(temp_signals)
[signals_by_date[i].remove(v) for v in signals_by_date[i] if v < 3]
The last line should read: