What do I use for a max-heap implementation in Python? September 23, 2022 by Tarik The easiest way is to invert the value of the keys and use heapq. For example, turn 1000.0 into -1000.0 and 5.0 into -5.0.