'How to remove outliers from the list of timedelta objects? Python 3

I have a list of timedelta objects like timedelta(seconds=345) and I need a pythonic way to remove outliers from it. For instance I may have:

timedelta_list = [timedelta(seconds=345), timedelta(seconds=445), timedelta(seconds=1225)]

and I need timedelta(seconds=1225) to be removed from this list. Any ideas on how to achieve this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source