
    Mhm                       S SK Jr  S SKJrJr  S SKrS SKJr  S SKJ	r	  S SK
Jr  S SKJr  S SKJr  \	(       a  S S	KJrJrJrJr  S S
KJrJr  S SKJrJrJr  \" S5      r\" S5      r\" S5      r\" S5      r SS\\\\ SS.r!\" S5      r"\" S5      r#SSS\\"\#SS.r$\" S5      r%S9S jr&S:S jr' S;   S<S jjr( " S S\5      r) " S S\)5      r* " S  S!\)5      r+ " S" S#5      r, " S$ S%\,5      r- " S& S'\,5      r. " S( S)\5      r/ " S* S+\/5      r0 " S, S-\05      r1 " S. S/\/5      r2 " S0 S1\0\25      r3 " S2 S3\/5      r4 " S4 S5\45      r5 " S6 S7\4\25      r6S=S8 jr7g)>    )annotations)ABCabstractmethodN)dedent)TYPE_CHECKING
get_option)format)pprint_thing)IterableIteratorMappingSequence)DtypeWriteBuffer)	DataFrameIndexSeriesa      max_cols : int, optional
        When to switch from the verbose to the truncated output. If the
        DataFrame has more than `max_cols` columns, the truncated output
        is used. By default, the setting in
        ``pandas.options.display.max_info_columns`` is used.aR      show_counts : bool, optional
        Whether to show the non-null counts. By default, this is shown
        only if the DataFrame is smaller than
        ``pandas.options.display.max_info_rows`` and
        ``pandas.options.display.max_info_columns``. A value of True always
        shows the counts, and False never shows the counts.a      >>> int_values = [1, 2, 3, 4, 5]
    >>> text_values = ['alpha', 'beta', 'gamma', 'delta', 'epsilon']
    >>> float_values = [0.0, 0.25, 0.5, 0.75, 1.0]
    >>> df = pd.DataFrame({"int_col": int_values, "text_col": text_values,
    ...                   "float_col": float_values})
    >>> df
        int_col text_col  float_col
    0        1    alpha       0.00
    1        2     beta       0.25
    2        3    gamma       0.50
    3        4    delta       0.75
    4        5  epsilon       1.00

    Prints information of all columns:

    >>> df.info(verbose=True)
    <class 'pandas.core.frame.DataFrame'>
    RangeIndex: 5 entries, 0 to 4
    Data columns (total 3 columns):
     #   Column     Non-Null Count  Dtype
    ---  ------     --------------  -----
     0   int_col    5 non-null      int64
     1   text_col   5 non-null      object
     2   float_col  5 non-null      float64
    dtypes: float64(1), int64(1), object(1)
    memory usage: 248.0+ bytes

    Prints a summary of columns count and its dtypes but not per column
    information:

    >>> df.info(verbose=False)
    <class 'pandas.core.frame.DataFrame'>
    RangeIndex: 5 entries, 0 to 4
    Columns: 3 entries, int_col to float_col
    dtypes: float64(1), int64(1), object(1)
    memory usage: 248.0+ bytes

    Pipe output of DataFrame.info to buffer instead of sys.stdout, get
    buffer content and writes to a text file:

    >>> import io
    >>> buffer = io.StringIO()
    >>> df.info(buf=buffer)
    >>> s = buffer.getvalue()
    >>> with open("df_info.txt", "w",
    ...           encoding="utf-8") as f:  # doctest: +SKIP
    ...     f.write(s)
    260

    The `memory_usage` parameter allows deep introspection mode, specially
    useful for big DataFrames and fine-tune memory optimization:

    >>> random_strings_array = np.random.choice(['a', 'b', 'c'], 10 ** 6)
    >>> df = pd.DataFrame({
    ...     'column_1': np.random.choice(['a', 'b', 'c'], 10 ** 6),
    ...     'column_2': np.random.choice(['a', 'b', 'c'], 10 ** 6),
    ...     'column_3': np.random.choice(['a', 'b', 'c'], 10 ** 6)
    ... })
    >>> df.info()
    <class 'pandas.core.frame.DataFrame'>
    RangeIndex: 1000000 entries, 0 to 999999
    Data columns (total 3 columns):
     #   Column    Non-Null Count    Dtype
    ---  ------    --------------    -----
     0   column_1  1000000 non-null  object
     1   column_2  1000000 non-null  object
     2   column_3  1000000 non-null  object
    dtypes: object(3)
    memory usage: 22.9+ MB

    >>> df.info(memory_usage='deep')
    <class 'pandas.core.frame.DataFrame'>
    RangeIndex: 1000000 entries, 0 to 999999
    Data columns (total 3 columns):
     #   Column    Non-Null Count    Dtype
    ---  ------    --------------    -----
     0   column_1  1000000 non-null  object
     1   column_2  1000000 non-null  object
     2   column_3  1000000 non-null  object
    dtypes: object(3)
    memory usage: 165.9 MBz    DataFrame.describe: Generate descriptive statistics of DataFrame
        columns.
    DataFrame.memory_usage: Memory usage of DataFrame columns.r   z and columns )klasstype_submax_cols_subshow_counts_subexamples_subsee_also_subversion_added_suba      >>> int_values = [1, 2, 3, 4, 5]
    >>> text_values = ['alpha', 'beta', 'gamma', 'delta', 'epsilon']
    >>> s = pd.Series(text_values, index=int_values)
    >>> s.info()
    <class 'pandas.core.series.Series'>
    Index: 5 entries, 1 to 5
    Series name: None
    Non-Null Count  Dtype
    --------------  -----
    5 non-null      object
    dtypes: object(1)
    memory usage: 80.0+ bytes

    Prints a summary excluding information about its values:

    >>> s.info(verbose=False)
    <class 'pandas.core.series.Series'>
    Index: 5 entries, 1 to 5
    dtypes: object(1)
    memory usage: 80.0+ bytes

    Pipe output of Series.info to buffer instead of sys.stdout, get
    buffer content and writes to a text file:

    >>> import io
    >>> buffer = io.StringIO()
    >>> s.info(buf=buffer)
    >>> s = buffer.getvalue()
    >>> with open("df_info.txt", "w",
    ...           encoding="utf-8") as f:  # doctest: +SKIP
    ...     f.write(s)
    260

    The `memory_usage` parameter allows deep introspection mode, specially
    useful for big Series and fine-tune memory optimization:

    >>> random_strings_array = np.random.choice(['a', 'b', 'c'], 10 ** 6)
    >>> s = pd.Series(np.random.choice(['a', 'b', 'c'], 10 ** 6))
    >>> s.info()
    <class 'pandas.core.series.Series'>
    RangeIndex: 1000000 entries, 0 to 999999
    Series name: None
    Non-Null Count    Dtype
    --------------    -----
    1000000 non-null  object
    dtypes: object(1)
    memory usage: 7.6+ MB

    >>> s.info(memory_usage='deep')
    <class 'pandas.core.series.Series'>
    RangeIndex: 1000000 entries, 0 to 999999
    Series name: None
    Non-Null Count    Dtype
    --------------    -----
    1000000 non-null  object
    dtypes: object(1)
    memory usage: 55.3 MBzp    Series.describe: Generate descriptive statistics of Series.
    Series.memory_usage: Memory usage of Series.r   z
.. versionadded:: 1.4.0
a  
    Print a concise summary of a {klass}.

    This method prints information about a {klass} including
    the index dtype{type_sub}, non-null values and memory usage.
    {version_added_sub}
    Parameters
    ----------
    verbose : bool, optional
        Whether to print the full summary. By default, the setting in
        ``pandas.options.display.max_info_columns`` is followed.
    buf : writable buffer, defaults to sys.stdout
        Where to send the output. By default, the output is printed to
        sys.stdout. Pass a writable buffer if you need to further process
        the output.
    {max_cols_sub}
    memory_usage : bool, str, optional
        Specifies whether total memory usage of the {klass}
        elements (including the index) should be displayed. By default,
        this follows the ``pandas.options.display.memory_usage`` setting.

        True always show memory usage. False never shows memory usage.
        A value of 'deep' is equivalent to "True with deep introspection".
        Memory usage is shown in human-readable units (base-2
        representation). Without deep introspection a memory estimation is
        made based in column dtype and number of rows assuming values
        consume the same memory amount for corresponding dtypes. With deep
        memory introspection, a real memory usage calculation is performed
        at the cost of computational resources. See the
        :ref:`Frequently Asked Questions <df-memory-usage>` for more
        details.
    {show_counts_sub}

    Returns
    -------
    None
        This method prints a summary of a {klass} and returns None.

    See Also
    --------
    {see_also_sub}

    Examples
    --------
    {examples_sub}
    c                <    [        U 5      SU R                  U5      $ )as  
Make string of specified length, padding to the right if necessary.

Parameters
----------
s : Union[str, Dtype]
    String to be formatted.
space : int
    Length to force string to be of.

Returns
-------
str
    String coerced to given length.

Examples
--------
>>> pd.io.formats.info._put_str("panda", 6)
'panda '
>>> pd.io.formats.info._put_str("panda", 4)
'pand'
N)strljust)sspaces     H/var/www/html/env/lib/python3.13/site-packages/pandas/io/formats/info.py_put_strr#   %  s    . q6&5>&&    c                R    S H  nU S:  a  U S U SU 3s  $ U S-  n M     U S U S3$ )a3  
Return size in human readable format.

Parameters
----------
num : int
    Size in bytes.
size_qualifier : str
    Either empty, or '+' (if lower bound).

Returns
-------
str
    Size in human readable format.

Examples
--------
>>> _sizeof_fmt(23028, '')
'22.5 KB'

>>> _sizeof_fmt(23028, '+')
'22.5+ KB'
)bytesKBMBGBTBg      @z3.1f z PB )numsize_qualifierxs      r"   _sizeof_fmtr0   ?  sL    0 /<$Z/q44v / $Z's++r$   c                "    U c  [        S5      n U $ )z5Get memory usage based on inputs and display options.zdisplay.memory_usager   )memory_usages    r"   _initialize_memory_usager3   ^  s     !"89r$   c                      \ rS rSr% SrS\S'   S\S'   \\SS j5       5       r\\SS j5       5       r	\\SS	 j5       5       r
\\SS
 j5       5       r\SS j5       r\SS j5       r\          SS j5       rSrg)	_BaseInfoig  aB  
Base class for DataFrameInfo and SeriesInfo.

Parameters
----------
data : DataFrame or Series
    Either dataframe or series.
memory_usage : bool or str, optional
    If "deep", introspect the data deeply by interrogating object dtypes
    for system-level memory consumption, and include it in the returned
    values.
DataFrame | Seriesdata
bool | strr2   c                    g)zq
Dtypes.

Returns
-------
dtypes : sequence
    Dtype of each of the DataFrame's columns (or one series column).
Nr,   selfs    r"   dtypes_BaseInfo.dtypesx      r$   c                    g)!Mapping dtype - number of counts.Nr,   r:   s    r"   dtype_counts_BaseInfo.dtype_counts  r>   r$   c                    g)BSequence of non-null counts for all columns or column (if series).Nr,   r:   s    r"   non_null_counts_BaseInfo.non_null_counts  r>   r$   c                    g)zl
Memory usage in bytes.

Returns
-------
memory_usage_bytes : int
    Object's total memory usage in bytes.
Nr,   r:   s    r"   memory_usage_bytes_BaseInfo.memory_usage_bytes  r>   r$   c                H    [        U R                  U R                  5       S3$ )z0Memory usage in a form of human readable string.
)r0   rH   r.   r:   s    r"   memory_usage_string_BaseInfo.memory_usage_string  s%     d55t7J7JKLBOOr$   c                    SnU R                   (       aK  U R                   S:w  a;  SU R                  ;   d)  U R                  R                  R	                  5       (       a  SnU$ )Nr   deepobject+)r2   rA   r7   index_is_memory_usage_qualified)r;   r.   s     r"   r.   _BaseInfo.size_qualifier  sP      F*
  1 11yyAACC%(Nr$   c                   g Nr,   )r;   bufmax_colsverboseshow_countss        r"   render_BaseInfo.render  s     	r$   r,   NreturnzIterable[Dtype]r^   Mapping[str, int]r^   Sequence[int]r^   intr^   r   
rW   WriteBuffer[str] | NonerX   
int | NonerY   bool | NonerZ   ri   r^   None)__name__
__module____qualname____firstlineno____doc____annotations__propertyr   r<   rA   rE   rH   rL   r.   r[   __static_attributes__r,   r$   r"   r5   r5   g  s        0  0 Q  Q    P P    % 	
  ! 
 r$   r5   c                      \ rS rSrSr S     SS jjr\SS j5       r\SS j5       r\SS j5       r	\SS j5       r
\SS	 j5       r\SS
 j5       r          SS jrSrg)DataFrameInfoi  z(
Class storing dataframe-specific info.
Nc                0    Xl         [        U5      U l        g rV   r7   r3   r2   r;   r7   r2   s      r"   __init__DataFrameInfo.__init__  s    
  $	4\Br$   c                ,    [        U R                  5      $ rV   )_get_dataframe_dtype_countsr7   r:   s    r"   rA   DataFrameInfo.dtype_counts  s    *49955r$   c                .    U R                   R                  $ )zO
Dtypes.

Returns
-------
dtypes
    Dtype of each of the DataFrame's columns.
r7   r<   r:   s    r"   r<   DataFrameInfo.dtypes  s     yyr$   c                .    U R                   R                  $ )zJ
Column names.

Returns
-------
ids : Index
    DataFrame's column names.
)r7   columnsr:   s    r"   idsDataFrameInfo.ids  s     yy   r$   c                ,    [        U R                  5      $ z#Number of columns to be summarized.)lenr   r:   s    r"   	col_countDataFrameInfo.col_count  s     488}r$   c                6    U R                   R                  5       $ )rD   r7   countr:   s    r"   rE   DataFrameInfo.non_null_counts  s     yy  r$   c                p    U R                   S:H  nU R                  R                  SUS9R                  5       $ )NrO   TrR   rO   )r2   r7   sumr;   rO   s     r"   rH    DataFrameInfo.memory_usage_bytes  s5      F*yy%%Dt%<@@BBr$   c               >    [        U UUUS9nUR                  U5        g )N)inforX   rY   rZ   )_DataFrameInfoPrinter	to_bufferr;   rW   rX   rY   rZ   printers         r"   r[   DataFrameInfo.render  s*     (#	
 	#r$   r7   r2   rV   )r7   r   r2   bool | str | Noner^   rj   r_   r]   r^   r   rc   ra   rf   )rk   rl   rm   rn   ro   rx   rq   rA   r<   r   r   rE   rH   r[   rr   r,   r$   r"   rt   rt     s     +/CC (C 
	C 6 6 	  	  	! 	!   ! ! C C % 	
  ! 
r$   rt   c                      \ rS rSrSr S     SS jjrSSSSS.         SS jjr\SS j5       r\SS j5       r	\SS	 j5       r
\SS
 j5       rSrg)
SeriesInfoi  z%
Class storing series-specific info.
Nc                0    Xl         [        U5      U l        g rV   rv   rw   s      r"   rx   SeriesInfo.__init__  s    
 !	4\Br$   )rW   rX   rY   rZ   c               X    Ub  [        S5      e[        U UUS9nUR                  U5        g )NzIArgument `max_cols` can only be passed in DataFrame.info, not Series.info)r   rY   rZ   )
ValueError_SeriesInfoPrinterr   r   s         r"   r[   SeriesInfo.render  sA     5  %#

 	#r$   c                8    U R                   R                  5       /$ rV   r   r:   s    r"   rE   SeriesInfo.non_null_counts$  s    		!""r$   c                0    U R                   R                  /$ rV   r~   r:   s    r"   r<   SeriesInfo.dtypes(  s    		  !!r$   c                D    SSK Jn  [        U" U R                  5      5      $ )Nr   )r   )pandas.core.framer   r{   r7   )r;   r   s     r"   rA   SeriesInfo.dtype_counts,  s    /*9TYY+?@@r$   c                T    U R                   S:H  nU R                  R                  SUS9$ )zkMemory usage in bytes.

Returns
-------
memory_usage_bytes : int
    Object's total memory usage in bytes.
rO   Tr   )r2   r7   r   s     r"   rH   SeriesInfo.memory_usage_bytes2  s.       F*yy%%Dt%<<r$   r   rV   )r7   r   r2   r   r^   rj   rf   ra   r]   r_   rc   )rk   rl   rm   rn   ro   rx   r[   rq   rE   r<   rA   rH   rr   r,   r$   r"   r   r     s     +/CC (C 
	C (,###' % 	
  ! 
( # # " " A A
 	= 	=r$   r   c                  :    \ rS rSrSrSSS jjr\S	S j5       rSrg)
_InfoPrinterAbstracti?  z.
Class for printing dataframe or series info.
Nc                    U R                  5       nUR                  5       nUc  [        R                  n[        R
                  " X5        g)z Save dataframe info into buffer.N)_create_table_builder	get_linessysstdoutfmtbuffer_put_lines)r;   rW   table_builderliness       r"   r   _InfoPrinterAbstract.to_bufferD  s:    224'');**CS(r$   c                    g)z!Create instance of table builder.Nr,   r:   s    r"   r   *_InfoPrinterAbstract._create_table_builderL  r>   r$   r,   rV   )rW   rg   r^   rj   )r^   _TableBuilderAbstract)	rk   rl   rm   rn   ro   r   r   r   rr   r,   r$   r"   r   r   ?  s     ) 0 0r$   r   c                      \ rS rSrSr   S         SS jjr\SS j5       r\SS j5       r\SS j5       r	\SS j5       r
SS	 jrSS
 jrSS jrSrg)r   iQ  aK  
Class for printing dataframe info.

Parameters
----------
info : DataFrameInfo
    Instance of DataFrameInfo.
max_cols : int, optional
    When to switch from the verbose to the truncated output.
verbose : bool, optional
    Whether to print the full summary.
show_counts : bool, optional
    Whether to show the non-null counts.
Nc                    Xl         UR                  U l        X0l        U R                  U5      U l        U R                  U5      U l        g rV   )r   r7   rY   _initialize_max_colsrX   _initialize_show_countsrZ   )r;   r   rX   rY   rZ   s        r"   rx   _DataFrameInfoPrinter.__init__a  s>     	II	11(;77Dr$   c                F    [        S[        U R                  5      S-   5      $ )z"Maximum info rows to be displayed.zdisplay.max_info_rows   )r	   r   r7   r:   s    r"   max_rows_DataFrameInfoPrinter.max_rowsn  s     13tyy>A3EFFr$   c                F    [        U R                  U R                  :  5      $ )zDCheck if number of columns to be summarized does not exceed maximum.)boolr   rX   r:   s    r"   exceeds_info_cols'_DataFrameInfoPrinter.exceeds_info_colss  s     DNNT]]233r$   c                X    [        [        U R                  5      U R                  :  5      $ )zACheck if number of rows to be summarized does not exceed maximum.)r   r   r7   r   r:   s    r"   exceeds_info_rows'_DataFrameInfoPrinter.exceeds_info_rowsx  s      C		NT]]233r$   c                .    U R                   R                  $ r   r   r   r:   s    r"   r   _DataFrameInfoPrinter.col_count}       yy"""r$   c                >    Uc  [        SU R                  S-   5      $ U$ )Nzdisplay.max_info_columnsr   )r	   r   )r;   rX   s     r"   r   *_DataFrameInfoPrinter._initialize_max_cols  s$    8$..1:LMMr$   c                p    Uc2  [        U R                  (       + =(       a    U R                  (       + 5      $ U$ rV   )r   r   r   r;   rZ   s     r"   r   -_DataFrameInfoPrinter._initialize_show_counts  s0    D222Q4;Q;Q7QRRr$   c                (   U R                   (       a  [        U R                  U R                  S9$ U R                   SL a  [	        U R                  S9$ U R
                  (       a  [	        U R                  S9$ [        U R                  U R                  S9$ )zK
Create instance of table builder based on verbosity and display settings.
r   with_countsFr   )rY   _DataFrameTableBuilderVerboser   rZ    _DataFrameTableBuilderNonVerboser   r:   s    r"   r   +_DataFrameInfoPrinter._create_table_builder  sz     <<0YY ,,  \\U"3CC##3CC0YY ,, r$   )r7   r   rX   rZ   rY   )NNN)
r   rt   rX   rh   rY   ri   rZ   ri   r^   rj   rc   r^   r   )rX   rh   r^   rd   rZ   ri   r^   r   )r^   _DataFrameTableBuilder)rk   rl   rm   rn   ro   rx   rq   r   r   r   r   r   r   r   rr   r,   r$   r"   r   r   Q  s    $  $##'EE E 	E
 !E 
E G G 4 4 4 4 # #
r$   r   c                  L    \ rS rSrSr  S       S	S jjrS
S jrSS jrSrg)r   i  zClass for printing series info.

Parameters
----------
info : SeriesInfo
    Instance of SeriesInfo.
verbose : bool, optional
    Whether to print the full summary.
show_counts : bool, optional
    Whether to show the non-null counts.
Nc                j    Xl         UR                  U l        X l        U R                  U5      U l        g rV   )r   r7   rY   r   rZ   )r;   r   rY   rZ   s       r"   rx   _SeriesInfoPrinter.__init__  s,     	II	77Dr$   c                    U R                   (       d  U R                   c  [        U R                  U R                  S9$ [	        U R                  S9$ )z6
Create instance of table builder based on verbosity.
r   r   )rY   _SeriesTableBuilderVerboser   rZ   _SeriesTableBuilderNonVerboser:   s    r"   r   (_SeriesInfoPrinter._create_table_builder  sB     <<4<</-YY ,, 
 1dii@@r$   c                    Uc  gU$ )NTr,   r   s     r"   r   *_SeriesInfoPrinter._initialize_show_counts  s    r$   )r7   r   rZ   rY   )NN)r   r   rY   ri   rZ   ri   r^   rj   )r^   _SeriesTableBuilderr   )	rk   rl   rm   rn   ro   rx   r   r   rr   r,   r$   r"   r   r     sJ    
  $#'		E	E 	E !		E
 
	E
Ar$   r   c                      \ rS rSr% SrS\S'   S\S'   \SS j5       r\SS j5       r	\SS	 j5       r
\SS
 j5       r\SS j5       r\SS j5       r\SS j5       rSS jrSS jrSS jrSrg)r   i  z"
Abstract builder for info table.
	list[str]_linesr5   r   c                    g)z-Product in a form of list of lines (strings).Nr,   r:   s    r"   r   _TableBuilderAbstract.get_lines  r>   r$   c                .    U R                   R                  $ rV   r   r7   r:   s    r"   r7   _TableBuilderAbstract.data  s    yy~~r$   c                .    U R                   R                  $ )z*Dtypes of each of the DataFrame's columns.)r   r<   r:   s    r"   r<   _TableBuilderAbstract.dtypes  s     yyr$   c                .    U R                   R                  $ )r@   )r   rA   r:   s    r"   rA   "_TableBuilderAbstract.dtype_counts  s     yy%%%r$   c                @    [        U R                  R                  5      $ )z Whether to display memory usage.)r   r   r2   r:   s    r"   display_memory_usage*_TableBuilderAbstract.display_memory_usage  s     DII**++r$   c                .    U R                   R                  $ )z/Memory usage string with proper size qualifier.)r   rL   r:   s    r"   rL   )_TableBuilderAbstract.memory_usage_string  s     yy,,,r$   c                .    U R                   R                  $ rV   )r   rE   r:   s    r"   rE   %_TableBuilderAbstract.non_null_counts  s    yy(((r$   c                r    U R                   R                  [        [        U R                  5      5      5        g)z>Add line with string representation of dataframe to the table.N)r   appendr   typer7   r:   s    r"   add_object_type_line*_TableBuilderAbstract.add_object_type_line  s!    3tDII/0r$   c                ~    U R                   R                  U R                  R                  R	                  5       5        g)z,Add line with range of indices to the table.N)r   r   r7   rR   _summaryr:   s    r"   add_index_range_line*_TableBuilderAbstract.add_index_range_line  s%    499??3356r$   c                    [        U R                  R                  5       5       VVs/ s H  u  pU SUS S3PM     nnnU R                  R	                  SSR                  U5       35        gs  snnf )z2Add summary line with dtypes present in dataframe.(d)zdtypes: z, N)sortedrA   itemsr   r   join)r;   keyvalcollected_dtypess       r"   add_dtypes_line%_TableBuilderAbstract.add_dtypes_line  sq     /5T5F5F5L5L5N.O
.O(#se1SG1.O 	 
 	Xdii0@&A%BCD
s   A-r,   Nr^   r   )r^   r6   r]   r_   r   re   ra   r^   rj   )rk   rl   rm   rn   ro   rp   r   r   rq   r7   r<   rA   r   rL   rE   r   r  r  rr   r,   r$   r"   r   r     s     
O< <       & & , , - - ) )17Er$   r   c                      \ rS rSrSrSS jrSS jrSS jr\SS j5       r	\
SS j5       r\
SS j5       r\
SS	 j5       rSS
 jrSrg)r   i  zx
Abstract builder for dataframe info table.

Parameters
----------
info : DataFrameInfo.
    Instance of DataFrameInfo.
c                   Xl         g rV   r   r;   r   s     r"   rx   _DataFrameTableBuilder.__init__  s    #'	r$   c                    / U l         U R                  S:X  a  U R                  5         U R                   $ U R                  5         U R                   $ )Nr   )r   r   _fill_empty_info_fill_non_empty_infor:   s    r"   r    _DataFrameTableBuilder.get_lines  sE    >>Q!!# {{ %%'{{r$   c                    U R                  5         U R                  5         U R                  R                  S[	        U R
                  5      R                   S35        g)z;Add lines to the info table, pertaining to empty dataframe.zEmpty rK   N)r   r  r   r   r   r7   rk   r:   s    r"   r  '_DataFrameTableBuilder._fill_empty_info  sD    !!#!!#VDO$<$<#=R@Ar$   c                    gz?Add lines to the info table, pertaining to non-empty dataframe.Nr,   r:   s    r"   r  +_DataFrameTableBuilder._fill_non_empty_info  r>   r$   c                .    U R                   R                  $ )z
DataFrame.r   r:   s    r"   r7   _DataFrameTableBuilder.data#       yy~~r$   c                .    U R                   R                  $ )zDataframe columns.)r   r   r:   s    r"   r   _DataFrameTableBuilder.ids(  s     yy}}r$   c                .    U R                   R                  $ )z-Number of dataframe columns to be summarized.r   r:   s    r"   r    _DataFrameTableBuilder.col_count-  r   r$   c                T    U R                   R                  SU R                   35        gz!Add line containing memory usage.zmemory usage: Nr   r   rL   r:   s    r"   add_memory_usage_line,_DataFrameTableBuilder.add_memory_usage_line2  "    ^D,D,D+EFGr$   r   r   N)r   rt   r^   rj   r  r  )r^   r   r   rc   )rk   rl   rm   rn   ro   rx   r   r  r   r  rq   r7   r   r   r*  rr   r,   r$   r"   r   r     so    (B N N     # #Hr$   r   c                  ,    \ rS rSrSrSS jrSS jrSrg)r   i7  z6
Dataframe info table builder for non-verbose output.
c                    U R                  5         U R                  5         U R                  5         U R                  5         U R                  (       a  U R                  5         ggr  )r   r  add_columns_summary_liner  r   r*  r:   s    r"   r  5_DataFrameTableBuilderNonVerbose._fill_non_empty_info<  sL    !!#!!#%%'$$&&( %r$   c                h    U R                   R                  U R                  R                  SS95        g )NColumnsname)r   r   r   r  r:   s    r"   r0  9_DataFrameTableBuilderNonVerbose.add_columns_summary_lineE  s&    488,,),<=r$   r,   Nr  )rk   rl   rm   rn   ro   r  r0  rr   r,   r$   r"   r   r   7  s    )>r$   r   c                      \ rS rSr% SrSrS\S'   S\S'   S\S	'   S
\S'   \\SS j5       5       r	\SS j5       r
SS jrSS jrSS jr\SS j5       r\SS j5       rSS jrSS jrSS jrSS jrSS jrSrg)_TableBuilderVerboseMixiniI  z 
Mixin for verbose info output.
z  r   SPACINGzSequence[Sequence[str]]strrowsrb   gross_column_widthsr   r   c                    g).Headers names of the columns in verbose table.Nr,   r:   s    r"   headers!_TableBuilderVerboseMixin.headersS  r>   r$   c                X    U R                    Vs/ s H  n[        U5      PM     sn$ s  snf )z'Widths of header columns (only titles).)r>  r   r;   cols     r"   header_column_widths._TableBuilderVerboseMixin.header_column_widthsX  s$     %)LL1LSCL111s   'c                    U R                  5       n[        U R                  U5       Vs/ s H  n[        U6 PM     sn$ s  snf )zAGet widths of columns containing both headers and actual content.)_get_body_column_widthsziprC  max)r;   body_column_widthswidthss      r"   _get_gross_column_widths2_TableBuilderVerboseMixin._get_gross_column_widths]  sJ    !99; d779KL
L LL
 	
 
s   >c                    [        [        U R                  6 5      nU Vs/ s H  n[        S U 5       5      PM     sn$ s  snf )z$Get widths of table content columns.c              3  8   #    U  H  n[        U5      v   M     g 7frV   )r   ).0r/   s     r"   	<genexpr>D_TableBuilderVerboseMixin._get_body_column_widths.<locals>.<genexpr>h  s     (CqCFFCs   )listrG  r:  rH  )r;   strcolsrB  s      r"   rF  1_TableBuilderVerboseMixin._get_body_column_widthse  s8    +/T\\0B+C4;<GS(C((G<<<s   ?c                d    U R                   (       a  U R                  5       $ U R                  5       $ )zl
Generator function yielding rows content.

Each element represents a row comprising a sequence of strings.
)r   _gen_rows_with_counts_gen_rows_without_countsr:   s    r"   	_gen_rows#_TableBuilderVerboseMixin._gen_rowsj  s+     --//0022r$   c                    gz=Iterator with string representation of body data with counts.Nr,   r:   s    r"   rV  /_TableBuilderVerboseMixin._gen_rows_with_countsu  r>   r$   c                    gz@Iterator with string representation of body data without counts.Nr,   r:   s    r"   rW  2_TableBuilderVerboseMixin._gen_rows_without_countsy  r>   r$   c           
         U R                   R                  [        U R                  U R                  5       VVs/ s H  u  p[        X5      PM     snn5      nU R                  R                  U5        g s  snnf rV   )r9  r  rG  r>  r;  r#   r   r   )r;   header	col_widthheader_lines       r"   add_header_line)_TableBuilderVerboseMixin.add_header_line}  se    ll'' *-T\\4;S;S)T)T%F +)T
 	;'s   A4
c           
         U R                   R                  [        U R                  U R                  5       VVs/ s H  u  p[        SU-  U5      PM     snn5      nU R                  R                  U5        g s  snnf )N-)r9  r  rG  rC  r;  r#   r   r   )r;   header_colwidthgross_colwidthseparator_lines       r"   add_separator_line,_TableBuilderVerboseMixin.add_separator_line  su    ** 8;--t/G/G883O .?8
 	>*s   A8
c                   U R                    Hj  nU R                  R                  [        XR                  5       VVs/ s H  u  p#[        X#5      PM     snn5      nU R                  R                  U5        Ml     g s  snnf rV   )r:  r9  r  rG  r;  r#   r   r   )r;   rowrB  ri  	body_lines        r"   add_body_lines(_TableBuilderVerboseMixin.add_body_lines  sm    <<C)) 0338P8P/Q/Q+ S1/QI KKy)  s   A<c              #  @   #    U R                    H
  nU S3v   M     g7f)z7Iterator with string representation of non-null counts.z	 non-nullN)rE   )r;   r   s     r"   _gen_non_null_counts._TableBuilderVerboseMixin._gen_non_null_counts  s"     ))EG9%% *s   c              #  L   #    U R                    H  n[        U5      v   M     g7f)z5Iterator with string representation of column dtypes.N)r<   r   )r;   dtypes     r"   _gen_dtypes%_TableBuilderVerboseMixin._gen_dtypes  s     [[Eu%% !   "$r,   Nr^   zSequence[str]ra   r^   zIterator[Sequence[str]]r  r^   zIterator[str])rk   rl   rm   rn   ro   r9  rp   rq   r   r>  rC  rK  rF  rX  rV  rW  rd  rk  rp  rs  rw  rr   r,   r$   r"   r8  r8  I  s     GS$$&&=  = 2 2
=
	3 L L O O(	+*&
&r$   r8  c                  ~    \ rS rSrSr      SS jrSS jr\SS j5       rSS jr	SS jr
SS jrSS	 jrSS
 jrSrg)r   i  z2
Dataframe info table builder for verbose output.
c                   Xl         X l        [        U R                  5       5      U l        U R                  5       U l        g rV   r   r   rR  rX  r:  rK  r;  r;   r   r   s      r"   rx   &_DataFrameTableBuilderVerbose.__init__  3     	&04T^^5E0F262O2O2Q r$   c                (   U R                  5         U R                  5         U R                  5         U R                  5         U R	                  5         U R                  5         U R                  5         U R                  (       a  U R                  5         ggr  )	r   r  r0  rd  rk  rp  r  r   r*  r:   s    r"   r  2_DataFrameTableBuilderVerbose._fill_non_empty_info  sp    !!#!!#%%'!$$&&( %r$   c                4    U R                   (       a  / SQ$ / SQ$ )r=  ) # ColumnNon-Null Countr   )r  r  r   r   r:   s    r"   r>  %_DataFrameTableBuilderVerbose.headers  s     ??))r$   c                V    U R                   R                  SU R                   S35        g )NzData columns (total z
 columns):)r   r   r   r:   s    r"   r0  6_DataFrameTableBuilderVerbose.add_columns_summary_line  s#    1$..1ALMr$   c              #     #    [        U R                  5       U R                  5       U R                  5       5       Sh  vN   g N7fr^  )rG  _gen_line_numbers_gen_columnsrw  r:   s    r"   rW  6_DataFrameTableBuilderVerbose._gen_rows_without_counts  s;     ""$
 	
 	
s   ;AAAc              #     #    [        U R                  5       U R                  5       U R                  5       U R	                  5       5       Sh  vN   g N7fr[  )rG  r  r  rs  rw  r:   s    r"   rV  3_DataFrameTableBuilderVerbose._gen_rows_with_counts  sG     ""$%%'	
 	
 	
s   A
AAAc              #  V   #    [        U R                  5       H  u  pSU 3v   M     g7f)z6Iterator with string representation of column numbers.r+   N)	enumerater   )r;   i_s      r"   r  /_DataFrameTableBuilderVerbose._gen_line_numbers  s%     dhh'DAaS'M (s   ')c              #  L   #    U R                    H  n[        U5      v   M     g7f)z4Iterator with string representation of column names.N)r   r   rA  s     r"   r  *_DataFrameTableBuilderVerbose._gen_columns  s     88Cs## ry  r;  r   r:  r   N)r   rt   r   r   r^   rj   r  rz  r{  r|  )rk   rl   rm   rn   ro   rx   r  rq   r>  r0  rW  rV  r  r  rr   r,   r$   r"   r   r     sa    	R 	R 		R
 
	R
) * *N


$r$   r   c                  ^    \ rS rSrSrS
S jrSS jr\SS j5       rSS jr	\
SS j5       rSrg	)r   i  zo
Abstract builder for series info table.

Parameters
----------
info : SeriesInfo.
    Instance of SeriesInfo.
c                   Xl         g rV   r   r  s     r"   rx   _SeriesTableBuilder.__init__  s     $	r$   c                H    / U l         U R                  5         U R                   $ rV   )r   r  r:   s    r"   r   _SeriesTableBuilder.get_lines  s    !!#{{r$   c                .    U R                   R                  $ )zSeries.r   r:   s    r"   r7   _SeriesTableBuilder.data  r"  r$   c                T    U R                   R                  SU R                   35        gr(  r)  r:   s    r"   r*  )_SeriesTableBuilder.add_memory_usage_line  r,  r$   c                    gz<Add lines to the info table, pertaining to non-empty series.Nr,   r:   s    r"   r  (_SeriesTableBuilder._fill_non_empty_info  r>   r$   r-  N)r   r   r^   rj   r  )r^   r   r  )rk   rl   rm   rn   ro   rx   r   rq   r7   r*  r   r  rr   r,   r$   r"   r   r     sA    %
  H K Kr$   r   c                  "    \ rS rSrSrSS jrSrg)r   i  z3
Series info table builder for non-verbose output.
c                    U R                  5         U R                  5         U R                  5         U R                  (       a  U R	                  5         ggr  )r   r  r  r   r*  r:   s    r"   r  2_SeriesTableBuilderNonVerbose._fill_non_empty_info  s@    !!#!!#$$&&( %r$   r,   Nr  )rk   rl   rm   rn   ro   r  rr   r,   r$   r"   r   r     s    )r$   r   c                  j    \ rS rSrSr      SS jrSS jrSS jr\SS j5       r	SS jr
SS jrS	rg
)r   i  z/
Series info table builder for verbose output.
c                   Xl         X l        [        U R                  5       5      U l        U R                  5       U l        g rV   r  r  s      r"   rx   #_SeriesTableBuilderVerbose.__init__  r  r$   c                (   U R                  5         U R                  5         U R                  5         U R                  5         U R	                  5         U R                  5         U R                  5         U R                  (       a  U R                  5         ggr  )	r   r  add_series_name_linerd  rk  rp  r  r   r*  r:   s    r"   r  /_SeriesTableBuilderVerbose._fill_non_empty_info&  sp    !!#!!#!!#!$$&&( %r$   c                h    U R                   R                  SU R                  R                   35        g )NzSeries name: )r   r   r7   r5  r:   s    r"   r  /_SeriesTableBuilderVerbose.add_series_name_line2  s$    ]499>>*:;<r$   c                2    U R                   (       a  SS/$ S/$ )r=  r  r   r  r:   s    r"   r>  "_SeriesTableBuilderVerbose.headers5  s      $g..yr$   c              #  @   #    U R                  5        Sh  vN   g N7fr^  )rw  r:   s    r"   rW  3_SeriesTableBuilderVerbose._gen_rows_without_counts<  s     ##%%%s   c              #  p   #    [        U R                  5       U R                  5       5       Sh  vN   g N7fr[  )rG  rs  rw  r:   s    r"   rV  0_SeriesTableBuilderVerbose._gen_rows_with_counts@  s/     %%'
 	
 	
s   ,646r  N)r   r   r   r   r^   rj   r  rz  r{  )rk   rl   rm   rn   ro   rx   r  r  rq   r>  rW  rV  rr   r,   r$   r"   r   r     sV    	R 	R 		R
 
	R
)=  &
r$   r   c                r    U R                   R                  5       R                  S 5      R                  5       $ )zC
Create mapping between datatypes and their number of occurrences.
c                    U R                   $ rV   r4  )r/   s    r"   <lambda>-_get_dataframe_dtype_counts.<locals>.<lambda>M  s    affr$   )r<   value_countsgroupbyr   )dfs    r"   r{   r{   H  s,    
 99!!#++,<=AACCr$   )r    zstr | Dtyper!   rd   r^   r   )r-   floatr.   r   r^   r   rV   )r2   r   r^   r8   )r  r   r^   r`   )8
__future__r   abcr   r   r   textwrapr   typingr   pandas._configr	   pandas.io.formatsr
   r   pandas.io.formats.printingr   collections.abcr   r   r   r   pandas._typingr   r   pandasr   r   r   frame_max_cols_subr   frame_examples_subframe_see_also_subframe_sub_kwargsseries_examples_subseries_see_also_subseries_sub_kwargsINFO_DOCSTRINGr#   r0   r3   r5   rt   r   r   r   r   r   r   r   r8  r   r   r   r   r{   r,   r$   r"   <module>r     s   "     % + 3 
  @  ? QS l B  &&&&  9; | 4  &''6  .0f'4,@ '+#P PfFI FR9= 9=x0 0$M0 M`(- (V5EC 5Ep0H2 0Hf>'= >$Z& 5 Z&z?$$:<U ?$DK/ K@)$7 )/
!46O /
dDr$   