Python Spectrum analyzer 'Max hold' function

How can I create a 'Max Hold' in Python on the Moku:Lab Spectrum Analyzer

The Moku:Lab's Spectrum Analyzer includes a math channel on both the iPad and Windows app.  This math channel has a useful 'max hold' function.

The attached Python script deploys a Spectrum Analyzer instrument,  sweeps the frequency and captures this data into Python. Within Python, we then calculate and display a 'Max Hold' trace.