
    Q/Phq                         U d Z ddlZddlmZ ddlmZmZ ddlZ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d	lmZ dd
lmZ dZeed<   dededefdZdede
j        dededef
dZdede
j        dedededefdZdS )z,Compute statistical description of datasets.    N)ThreadPoolExecutor)AnyTuple)tqdm)VisionsTypeset)Settings)ProfilingTypeSet)optional_option_context)sort_column_namesBaseSummarizertypesetseriesreturnc                 >    t          | t                    o|| j        v S )N)
isinstancer	   type_schema)r   r   s     k/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/ydata_profiling/model/pandas/summary_pandas.py_is_cast_type_definedr      s     g/00RVw?R5RR    config
summarizerc                    t          dd          5  |                    t          j                                      d          }ddd           n# 1 swxY w Y   t          ||j                  }|rt          |j        |j                           nd}|r9|	                                
                                s|j        |j                 }nG| j        r+|                    |          }|                    |          }n|                    |          }||j        |j        <   |                    | ||          }||d<   |S )a?  Describe a series (infer the variable type, then calculate type-specific values).

    Args:
        config: report Settings object
        series: The Series to describe.
        summarizer: Summarizer object
        typeset: Typeset

    Returns:
        A Series containing calculated series description values.
    zfuture.no_silent_downcastingTF)copyN)dtype	cast_type)r
   fillnanpnaninfer_objectsr   namestrr   isnaallinfer_dtypes
infer_typecast_to_inferreddetect_type	summarize)r   r   r   r   has_cast_typer   vtypesummarys           r   pandas_describe_1dr,      s   & 
!!?	F	F A Arv&&44%4@@A A A A A A A A A A A A A A A *'6;??M1>HG,---D   
,V[[]]..00 
,#FK0		 ,""6**))&11 ##F++',G$""66"??G %GKNs   4AAAdfpbarc                 "    dt           dt          j        dt          t           t          f         f fd j        dk    r j        nt          j                    }i }t          |          5 fd|	                                D             }t          |                                t          |                    D ]}|                                \  }	}
|
||	<   	 d d d            n# 1 swxY w Y   t          | j                  S )	Nr    r   r   c                                          d|             t          |          }                                 | |fS )z6Process a single series to get the column description.zDescribe variable: )set_postfix_strr,   update)r    r   descriptionr   r.   r   r   s      r   describe_columnz7pandas_get_series_descriptions.<locals>.describe_columnN   sK    9499:::(WMM[  r   r   )max_workersc                 F    i | ]\  }}                     ||          |S  )submit).0r    r   r4   executors      r   
<dictcomp>z2pandas_get_series_descriptions.<locals>.<dictcomp>\   s?     
 
 
f OOOT6::D
 
 
r   )total)r!   pdSeriesr   dict	pool_sizemultiprocessing	cpu_countr   itemsr   keyslenresultr   sort)r   r-   r   r   r.   r@   series_descriptionfuture_to_colfuturer    r3   r4   r:   s   ` ```      @@r   pandas_get_series_descriptionsrK   G   s   !c !29 !sDy9I ! ! ! ! ! ! ! ! ! #,q00o6O6Q6Q  			2	2	2 3h
 
 
 
 
 "


 
 

 =--//s=7I7IJJJ 	3 	3F &D+'2t$$	33 3 3 3 3 3 3 3 3 3 3 3 3 3 3 /===s   3A1C11C58C5) __doc__rA   concurrent.futuresr   typingr   r   numpyr   pandasr=   r   visionsr   ydata_profiling.configr   ydata_profiling.model.typesetr	   ydata_profiling.utils.compatr
   ydata_profiling.utils.dataframer   r   __annotations__r!   boolr   r>   r?   r,   	DataFramerK   r7   r   r   <module>rY      s   2 2 2     1 1 1 1 1 1                       " " " " " " + + + + + + : : : : : : @ @ @ @ @ @ = = = = = =& & & &S> S3 S4 S S S S--I- - 	-
 
- - - -`>>
> > 	>
 > 
> > > > > >r   