The zonal statistics tool within QGIS is able to calculate the average raster variance within an area of interest. I am now trying to automate this in Python.
I typically use zonal_stats from the rasterstats library for calculating zonal statistics in Python, but zonal_stats is only able to calculate min, max, mean, count, sum, std, median, majority, minority, unique, range, nodata, and percentile.
How would I calculate raster variance over an area of interest in Python?