
     h                     J    d dl Zd dlmZ d dlmZ ddlmZ ddl	m
Z
 d Zd ZdS )	    N)sparse)suppress   )is_scalar_nan)_object_dtype_isnanc                    t          t          t                    5  dd l}||j        u r!|                    |           cd d d            S 	 d d d            n# 1 swxY w Y   t          |          rd| j        j        dk    rt          j
        |           }nE| j        j        dv r!t          j        | j        t                    }nt          |           }n| |k    }|S )Nr   f)iu)dtype)r   ImportErrorAttributeErrorpandasNAisnar   r   kindnpisnanzerosshapeboolr   )Xvalue_to_maskr   Xts       O/var/www/html/Sam_Eipo/venv/lib/python3.11/site-packages/sklearn/utils/_mask.py_get_dense_maskr   	   s0   	+~	.	. " " 	FI%%;;q>>" " " " " " " "
 &" " " " " " " " " " " " " " " ]## 
 7<3!BBW\Z''!'...BB %Q''BB-Is   "AAAc                 P   t          j        |           st          | |          S t          | j        |          }| j        dk    rt           j        nt           j        } ||| j                                        | j	                                        f| j
        t                    }|S )a  Compute the boolean mask X == value_to_mask.

    Parameters
    ----------
    X : {ndarray, sparse matrix} of shape (n_samples, n_features)
        Input data, where ``n_samples`` is the number of samples and
        ``n_features`` is the number of features.

    value_to_mask : {int, float}
        The value which is to be masked in X.

    Returns
    -------
    X_mask : {ndarray, sparse matrix} of shape (n_samples, n_features)
        Missing mask.
    csr)r   r   )spissparser   dataformat
csr_matrix
csc_matrixindicescopyindptrr   r   )r   r   r   sparse_constructor	Xt_sparses        r   	_get_maskr*   !   s    " ;q>> 1 q-000		/	/B*+(e*;*;""	QY^^qx}}/qwd  I     )numpyr   scipyr   r   
contextlibr    r   fixesr   r   r*    r+   r   <module>r2      s                          & & & & & &  0    r+   