Getting the n elements of a list in order from the largest and smallest values in Python https://from-locals.com/python-max-min-heapq-nlargest-nsmallest/