The precise problem has previously been solved in preceding answers, so I'll handle the overall notion of applying conditionals within list comprehensions.Why is accessing aspects employing `tolist` more quickly than accessing it instantly in the pandas sequence? twoShawn ChinShawn Chin 87.2k2020 gold badges168168 silver badges193193 bronze badges