
    Q/Ph                         d dl mZ d dlZd dlmZ d dlmZmZ  ej	        eej
                  dedej
        dee         fd            ZdS )	    )ListN)Settings)Sample
get_sampleconfigdfreturnc                    g }t          |          dk    r|S | j        j        }|dk    r9|                    t	          d|                    |          d                     | j        j        }|dk    r9|                    t	          d|                    |          d                     | j        j        }|dk    r9|                    t	          d|                    |          d	                     |S )
zObtains a sample from head and tail of the DataFrame

    Args:
        config: Settings object
        df: the pandas DataFrame

    Returns:
        a list of Sample objects
    r   head)nz
First rows)iddatanametailz	Last rowsrandomzRandom sample)lensamplesr   appendr   r   r   sample)r   r   r   n_headn_tailn_randoms         j/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/ydata_profiling/model/pandas/sample_pandas.pypandas_get_sampler   	   s     G
2ww!||^ Fzzvbggg.?.?lSSSTTT^ Fzzvbggg.?.?kRRRSSS~$H!||hRYYY%:%:QQQ	
 	
 	
 N    )typingr   pandaspdydata_profiling.configr   ydata_profiling.model.sampler   r   register	DataFramer    r   r   <module>r$      s              + + + + + + ; ; ; ; ; ; ; ; Xr|,,h BL T&\    -,  r   