Encoder.categorize_cols

Divide continuous columns into categories. [source]
Returns:
file_names : list
  The name name of all files text inside the folder.
See also:
encoder.standardize_categorical_cols
 Standardize the given categorical columns into the same format.

encoder.encode_df
  Encode the given categorical columns into patterned strings.

Example:

# Imports
>>> from zgli.encoder import Encoder
>>> from sklearn import datasets

# Load Iris df
>>> iris = datasets.load_iris()
>>> iris_df = pd.DataFrame(iris['data'])

# Define iris df cols
>>> cols = [0,1,2,3]

# Divide iris df
>>> cuts = [4,4,4,4]
>>> encoder = Encoder()
>>> df_ct = encoder.categorize_cols(iris_df,cols,cuts) # We use the categorize function here.
>>> df_ct.head()
        0		1		2		3
0	(4.296, 5.2]	(3.2, 3.8]	(0.994, 2.475]	(0.0976, 0.7]
1	(4.296, 5.2]	(2.6, 3.2]	(0.994, 2.475]	(0.0976, 0.7]
2	(4.296, 5.2]	(2.6, 3.2]	(0.994, 2.475]	(0.0976, 0.7]
3	(4.296, 5.2]	(2.6, 3.2]	(0.994, 2.475]	(0.0976, 0.7]
4	(4.296, 5.2]	(3.2, 3.8]	(0.994, 2.475]	(0.0976, 0.7]