def get_median(self, totals): try: return statistics.median(totals) except statistics.StatisticsError: return 0