docs: def median(self, func=lambda x: x):
          """
          Return the median value of data elements
          :param func: lambda expression to project and sort data
          :return: median value
          """
          if self.count() == 0:
              raise NoElementsError(u"Iterable contains no elements")
          result = self.order_by(func).select(func).to_list()
          length = len(result)
          i = int(length / 2)
          return result[i] if length % 2 == 1 else (float(result[i - 1]) + float(result[i])) / float(2)