A simple package to find the nth max and nth min in a list.
pip install nmaxmin
Below example would help
from nmaxmin import nmaxmin
l = [1,2,3,4,5]
nmaxmin.maxn(l,2) # returns 2nd max element from list
nmaxmin.minn(l,4) # returns 4th minimum element from the list
Feel free to create issues, if you find any :)