python/pymethylprocess/MethylationDataTypes.py
def bin_column(self, col, n_bins):
        """Turn continuous variable/covariate into categorical bins.
        Returns name of new column and updates phenotype matrix to reflect this change.

        Parameters
        ----------
        col
            Continuous column of phenotype array to bin.
        n_bins
            Number of bins to create.
        """
        new_col_name='{}_{}'.format(col,'binned')
        self.pheno[new_col_name]=np.vectorize(lambda x: x.replace(' ',''))(pd.cut(self.pheno[col],n_bins).astype(str))
        return new_col_name
Turn continuous variable/covariate into categorical bins.
        Returns name of new column and updates phenotype matrix to reflect this change.

        Parameters
        ----------
        col
            Continuous column of phenotype array to bin.
        n_bins
            Number of bins to create.
        
Turn continuous variable/covariate into categorical bins.
Returns name of new column and updates phenotype matrix to reflect this change.

Parameters

col
Continuous column of phenotype array to bin.
n_bins
Number of bins to create.
Turn continuous variable / covariate into categorical bins . Returns name of new column and updates phenotype matrix to reflect this change . Parameters col Continuous column of phenotype array to bin . n_bins Number of bins to create .
def bin_column(self, col, n_bins):
        new_col_name='{}_{}'.format(col,'binned')
        self.pheno[new_col_name]=np.vectorize(lambda x: x.replace(' ',''))(pd.cut(self.pheno[col],n_bins).astype(str))
        return new_col_name
def bin_column ( self , col , n_bins ) : new_col_name = '{}_{}' . format ( col , 'binned' ) self . pheno [ new_col_name ] = np . vectorize ( lambda x : x . replace ( ' ' , '' ) ) ( pd . cut ( self . pheno [ col ] , n_bins ) . astype ( str ) ) return new_col_name
Turn continuous variable/covariate into categorical bins.
Turn continuous variable / covariate into categorical bins .
"""Turn continuous variable/covariate into categorical bins.
        Returns name of new column and updates phenotype matrix to reflect this change.

        Parameters
        ----------
        col
            Continuous column of phenotype array to bin.
        n_bins
            Number of bins to create.
        """
self
col
n_bins