def psi_variable_table(self, name=None, style="summary"):
        """Population Stability Index (PSI) at variable level.

        Parameters
        ----------
        name : str or None (default=None)
            The variable name. If name is None, a table with all variables
            is returned.

        style : str, optional (default="summary")
            Supported styles are "summary" and "detailed". Summary only
            includes the total PSI for each variable. Detailed includes the
            PSI for each variable at bin level.

        Returns
        -------
        psi_table : pandas.DataFrame
        """
        self._check_is_fitted()

        if style not in ("summary", "detailed"):
            raise ValueError('Invalid value for style. Allowed string '
                             'values are "summary" and "detailed".')

        if name is not None:
            variables = self.scorecard.binning_process_.get_support(names=True)

            if name not in variables:
                raise ValueError("name {} does not match a binned variable "
                                 "included in the provided scorecard."
                                 .format(name))

            dv = self._df_psi_variable[self._df_psi_variable.Variable == name]

            if style == "summary":
                return dv.groupby(["Variable"])["PSI"].sum()
            else:
                return dv

        if style == "summary":
            return pd.DataFrame(
                self._df_psi_variable.groupby(['Variable'])['PSI'].sum()
                ).reset_index()
        elif style == "detailed":
            return self._df_psi_variable
Population Stability Index (PSI) at variable level.

        Parameters
        ----------
        name : str or None (default=None)
            The variable name. If name is None, a table with all variables
            is returned.

        style : str, optional (default="summary")
            Supported styles are "summary" and "detailed". Summary only
            includes the total PSI for each variable. Detailed includes the
            PSI for each variable at bin level.

        Returns
        -------
        psi_table : pandas.DataFrame
        
optbinning/scorecard/monitoring.py