def from_series ( series ) : result = PercentRankTransform ( ) result . cdf = series . values result . bin_edges = series . index . values [ 1 : - 1 ] return result
python converta series to percentage
Deseralize a PercentRankTransform the given pandas . Series as returned by to_series () .
def from_series(series):
        """
        Deseralize a PercentRankTransform the given pandas.Series, as returned
        by `to_series()`.

        Parameters
        ----------
        series : pandas.Series

        Returns
        -------
        PercentRankTransform

        """
        result = PercentRankTransform()
        result.cdf = series.values
        result.bin_edges = series.index.values[1:-1]
        return result