def calculate_statistic(self, variable, statistic):
        # Apply statistic
        for stat in self.statistics:
            if statistic in stat[1]:
                func = getattr(stat[0], stat[1][statistic])
                break
        else:
            # Default
            func = getattr(numpy.ma, 'mean')
        return func(variable)

    # ---------------------------------------------------------
Creates the toolkit-specific control that represents the view.
dataset/ETHPy150Open Esri/solutions-geoprocessing-toolbox/suitability/toolboxes/scripts/MultidimensionSupplementalTools/MultidimensionSupplementalTools/Scripts/mds/tools/multidimensional_zonal_statistics.py/MultidimensionalZonalStatistics.calculate_statistic--crossover with--dataset/ETHPy150Open enthought/envisage/envisage/plugins/python_shell/view/python_shell_view.py/PythonShellView.create_control