
    \!hn                         S SK rSS jrg)    Nc                 
   US:X  d   [        U[        5      (       d  [        S5      e[        U [        5      (       a  [        R
                  " U 5      nOU n[        UR                  5      S:X  d  [        S5      eUS:X  a  [        R                  " US-   5      nOUnUS:X  a  [        R                  " S//US9nO;[        R                  " [        U 5      U45      n[        U 5       H  u  pgSXVU4'   M     UR                  U5      $ )a  One-hot encoding of class labels

Parameters
----------
y : array-like, shape = [n_classlabels]
    Python list or numpy array consisting of class labels.
num_labels : int or 'auto'
    Number of unique labels in the class label array. Infers the number
    of unique labels from the input array if set to 'auto'.
dtype : str
    NumPy array type (float, float32, float64) of the output array.

Returns
----------
ary : numpy.ndarray, shape = [n_classlabels]
    One-hot encoded array, where each sample is represented as
    a row vector in the returned array.

Examples
----------
For usage examples, please see
https://rasbt.github.io/mlxtend/user_guide/preprocessing/one_hot/

autoz'num_labels must be an integer or "auto"   zy array must be 1-dimensionalg        )dtype)
isinstanceintAttributeErrorlistnpasarraylenshapemaxarrayzeros	enumerateastype)y
num_labelsr   ytuniqaryivals           oC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\mlxtend/preprocessing/onehot.pyone_hotr   
   s    2 & Jz3$?$?FGG!TZZ]rxx=A<==Vvvb1f~qyhhwe, hhA~&lFAC3K # ::e    )r   float)numpyr   r    r   r   <module>r!      s    .r   