Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/pandas/io/formats/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/pandas/io/formats/__pycache__/info.cpython-312.pyc

�

Mٜgm���ddlmZddlmZmZddlZddlmZddlm	Z	ddl
mZddlm
ZddlmZe	rdd	lmZmZmZmZdd
lmZmZddlmZmZmZed�Zed
�Zed�Zed�Z ddeeee dd�Z!ed�Z"ed�Z#dddee"e#dd�Z$ed�Z%d9d�Z&d:d�Z'	d;			d<d�Z(Gd�de�Z)Gd�de)�Z*Gd �d!e)�Z+Gd"�d#�Z,Gd$�d%e,�Z-Gd&�d'e,�Z.Gd(�d)e�Z/Gd*�d+e/�Z0Gd,�d-e0�Z1Gd.�d/e/�Z2Gd0�d1e0e2�Z3Gd2�d3e/�Z4Gd4�d5e4�Z5Gd6�d7e4e2�Z6d=d8�Z7y)>�)�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.rz 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.rz
.. 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�<�t|�d|j|�S)a�
    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  �A/usr/local/lib/python3.12/site-packages/pandas/io/formats/info.py�_put_strr#%s��.�q�6�&�5�>����&�&�c�L�dD]}|dkr|d�|�d|��cS|dz}�|d�|�d�S)a{
    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�@z3.1f� z PB�)�num�size_qualifier�xs   r"�_sizeof_fmtr0?sL��0/����<��$�Z��/�q���4�4��v�
��/��$�Z��'�s�+�+r$c� �|�td�}|S)z5Get memory usage based on inputs and display options.zdisplay.memory_usager)�memory_usages r"�_initialize_memory_usager3^s����!�"8�9���r$c���eZdZUdZded<ded<eedd���Zeedd���Zeedd���Z	eedd	���Z
edd
��Zedd��Ze										dd��Z
y
)�	_BaseInfoaj
    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 | strr2c��y)z�
        Dtypes.

        Returns
        -------
        dtypes : sequence
            Dtype of each of the DataFrame's columns (or one series column).
        Nr,��selfs r"�dtypesz_BaseInfo.dtypesx��r$c��y)�!Mapping dtype - number of counts.Nr,r:s r"�dtype_countsz_BaseInfo.dtype_counts�r=r$c��y)�BSequence of non-null counts for all columns or column (if series).Nr,r:s r"�non_null_countsz_BaseInfo.non_null_counts�r=r$c��y)z�
        Memory usage in bytes.

        Returns
        -------
        memory_usage_bytes : int
            Object's total memory usage in bytes.
        Nr,r:s r"�memory_usage_bytesz_BaseInfo.memory_usage_bytes�r=r$c�H�t|j|j��d�S)z0Memory usage in a form of human readable string.�
)r0rEr.r:s r"�memory_usage_stringz_BaseInfo.memory_usage_string�s%���d�5�5�t�7J�7J�K�L�B�O�Or$c��d}|jrC|jdk7r4d|jvs$|jjj	�rd}|S)Nr�deep�object�+)r2r@r7�index�_is_memory_usage_qualified)r;r.s  r"r.z_BaseInfo.size_qualifier�sM�������� � �F�*�
�� 1� 1�1��y�y���A�A�C�%(�N��r$c��y�Nr,)r;�buf�max_cols�verbose�show_countss     r"�renderz_BaseInfo.render�s��	
r$N��returnzIterable[Dtype]�rW�Mapping[str, int]�rW�
Sequence[int]�rW�int�rWr�
rQ�WriteBuffer[str] | NonerR�
int | NonerS�bool | NonerTrbrW�None)�__name__�
__module__�__qualname__�__doc__�__annotations__�propertyrr<r@rCrErHr.rUr,r$r"r5r5gs��������
��������0���0���Q���Q��������P��P������
�%�
��	
�
�
�!�

�
�
��
r$r5c��eZdZdZ	d					dd�Zed
d��Zedd��Zedd��Zedd��Z	edd��Z
edd	��Z										dd
�Zy)�
DataFrameInfoz0
    Class storing dataframe-specific info.
    Nc�2�||_t|�|_yrP�r7r3r2�r;r7r2s   r"�__init__zDataFrameInfo.__init__�s��
 $��	�4�\�B��r$c�,�t|j�SrP)�_get_dataframe_dtype_countsr7r:s r"r@zDataFrameInfo.dtype_counts�s��*�4�9�9�5�5r$c�.�|jjS)z
        Dtypes.

        Returns
        -------
        dtypes
            Dtype of each of the DataFrame's columns.
        �r7r<r:s r"r<zDataFrameInfo.dtypes�s���y�y���r$c�.�|jjS)zz
        Column names.

        Returns
        -------
        ids : Index
            DataFrame's column names.
        )r7�columnsr:s r"�idszDataFrameInfo.ids�s���y�y� � � r$c�,�t|j�S�z#Number of columns to be summarized.)�lenrvr:s r"�	col_countzDataFrameInfo.col_count�s���4�8�8�}�r$c�6�|jj�S)rB�r7�countr:s r"rCzDataFrameInfo.non_null_counts�s���y�y��� � r$c�v�|jdk(}|jjd|��j�S)NrJT�rMrJ)r2r7�sum�r;rJs  r"rEz DataFrameInfo.memory_usage_bytes�s5��� � �F�*���y�y�%�%�D�t�%�<�@�@�B�Br$c�D�t||||��}|j|�y)N)�inforRrSrT)�_DataFrameInfoPrinter�	to_buffer�r;rQrRrSrT�printers      r"rUzDataFrameInfo.render�s*��(����#�	
��	���#�r$rP)r7rr2�bool | str | NonerWrcrXrV�rWrr\rZr_)
rdrerfrgrorir@r<rvrzrCrErUr,r$r"rkrk�s����+/�C��C�(�C�
�	C��6��6��	 ��	 ��	!��	!������!��!��C��C��%���	�
��!�
�
�r$rkc��eZdZdZ	d
					dd�Zddddd�									dd�Zed
d��Zedd��Zedd��Z	edd	��Z
y)�
SeriesInfoz-
    Class storing series-specific info.
    Nc�2�||_t|�|_yrPrmrns   r"rozSeriesInfo.__init__s��
!��	�4�\�B��r$)rQrRrSrTc�\�|�td��t|||��}|j|�y)NzIArgument `max_cols` can only be passed in DataFrame.info, not Series.info)r�rSrT)�
ValueError�_SeriesInfoPrinterr�r�s      r"rUzSeriesInfo.rendersA�����5��
�%���#�
��
	���#�r$c�8�|jj�gSrPr|r:s r"rCzSeriesInfo.non_null_counts$s���	�	���!�"�"r$c�0�|jjgSrPrsr:s r"r<zSeriesInfo.dtypes(s���	�	� � �!�!r$c�D�ddlm}t||j��S)Nr)r)�pandas.core.framerrqr7)r;rs  r"r@zSeriesInfo.dtype_counts,s��/�*�9�T�Y�Y�+?�@�@r$c�Z�|jdk(}|jjd|��S)z�Memory usage in bytes.

        Returns
        -------
        memory_usage_bytes : int
            Object's total memory usage in bytes.
        rJTr)r2r7r�s  r"rEzSeriesInfo.memory_usage_bytes2s.��� � �F�*���y�y�%�%�D�t�%�<�<r$rP)r7rr2r�rWrcr_rZrVrXr\)rdrerfrgrorUrirCr<r@rEr,r$r"r�r�s����+/�C��C�(�C�
�	C�(,�#�#�#'�
�%���	�
��!�
�
��(�#��#��"��"��A��A�
�	=��	=r$r�c�,�eZdZdZddd�Zedd��Zy)�_InfoPrinterAbstractz6
    Class for printing dataframe or series info.
    Nc��|j�}|j�}|�tj}t	j
||�y)z Save dataframe info into buffer.N)�_create_table_builder�	get_lines�sys�stdout�fmt�buffer_put_lines)r;rQ�
table_builder�liness    r"r�z_InfoPrinterAbstract.to_bufferDs<���2�2�4�
��'�'�)���;��*�*�C����S�%�(r$c��y)z!Create instance of table builder.Nr,r:s r"r�z*_InfoPrinterAbstract._create_table_builderLr=r$rP)rQr`rWrc)rW�_TableBuilderAbstract)rdrerfrgr�rr�r,r$r"r�r�?s ���)��0��0r$r�c��eZdZdZ			d									dd�Zed
d��Zedd��Zedd��Zed
d��Z	dd�Z
dd	�Zdd
�Zy)r�a{
    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��||_|j|_||_|j|�|_|j|�|_yrP)r�r7rS�_initialize_max_colsrR�_initialize_show_countsrT)r;r�rRrSrTs     r"roz_DataFrameInfoPrinter.__init__asB����	��I�I��	�����1�1�(�;��
��7�7��D��r$c�F�tdt|j�dz�S)z"Maximum info rows to be displayed.zdisplay.max_info_rows�)r	ryr7r:s r"�max_rowsz_DataFrameInfoPrinter.max_rowsns���1�3�t�y�y�>�A�3E�F�Fr$c�F�t|j|jkD�S)zDCheck if number of columns to be summarized does not exceed maximum.)�boolrzrRr:s r"�exceeds_info_colsz'_DataFrameInfoPrinter.exceeds_info_colsss���D�N�N�T�]�]�2�3�3r$c�X�tt|j�|jkD�S)zACheck if number of rows to be summarized does not exceed maximum.)r�ryr7r�r:s r"�exceeds_info_rowsz'_DataFrameInfoPrinter.exceeds_info_rowsxs ���C��	�	�N�T�]�]�2�3�3r$c�.�|jjSrx�r�rzr:s r"rzz_DataFrameInfoPrinter.col_count}����y�y�"�"�"r$c�<�|�td|jdz�S|S)Nzdisplay.max_info_columnsr�)r	rz)r;rRs  r"r�z*_DataFrameInfoPrinter._initialize_max_cols�s$�����8�$�.�.�1�:L�M�M��r$c�T�|�%t|jxr
|j�S|SrP)r�r�r��r;rTs  r"r�z-_DataFrameInfoPrinter._initialize_show_counts�s0�����D�2�2�2�Q�4�;Q�;Q�7Q�R�R��r$c�*�|jr!t|j|j��S|jdurt	|j��S|j
rt	|j��St|j|j��S)z[
        Create instance of table builder based on verbosity and display settings.
        �r��with_countsF�r�)rS�_DataFrameTableBuilderVerboser�rT� _DataFrameTableBuilderNonVerboser�r:s r"r�z+_DataFrameInfoPrinter._create_table_builder�sz���<�<�0��Y�Y� �,�,��
��\�\�U�
"�3����C�C�
�
#�
#�3����C�C�0��Y�Y� �,�,��
r$)NNN)
r�rkrRrarSrbrTrbrWrcr\�rWr�)rRrarWr]�rTrbrWr�)rW�_DataFrameTableBuilder)
rdrerfrgrorir�r�r�rzr�r�r�r,r$r"r�r�Qs���
�$ $�#�#'�E��E��E��	E�
!�E�
�
E��G��G��4��4��4��4��#��#��
�r$r�c�<�eZdZdZ		d							dd�Zdd�Zd	d�Zy)
r�aClass 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�n�||_|j|_||_|j|�|_yrP)r�r7rSr�rT)r;r�rSrTs    r"roz_SeriesInfoPrinter.__init__�s0����	��I�I��	�����7�7��D��r$c��|js|j�!t|j|j��St	|j��S)zF
        Create instance of table builder based on verbosity.
        r�r�)rS�_SeriesTableBuilderVerboser�rT�_SeriesTableBuilderNonVerboser:s r"r�z(_SeriesInfoPrinter._create_table_builder�sB���<�<�4�<�<�/�-��Y�Y� �,�,��
�
1�d�i�i�@�@r$c��|�y|S)NTr,r�s  r"r�z*_SeriesInfoPrinter._initialize_show_counts�s������r$)NN)r�r�rSrbrTrbrWrc)rW�_SeriesTableBuilderr�)rdrerfrgror�r�r,r$r"r�r��sJ��
� $�#'�		E��	E��	E�!�		E�

�	E�
A�r$r�c��eZdZUdZded<ded<edd��Zedd��Zedd��Z	edd	��Z
edd
��Zedd��Zedd��Z
dd
�Zdd�Zdd�Zy)r�z*
    Abstract builder for info table.
    �	list[str]�_linesr5r�c��y)z-Product in a form of list of lines (strings).Nr,r:s r"r�z_TableBuilderAbstract.get_lines�r=r$c�.�|jjSrP�r�r7r:s r"r7z_TableBuilderAbstract.data�s���y�y�~�~�r$c�.�|jjS)z*Dtypes of each of the DataFrame's columns.)r�r<r:s r"r<z_TableBuilderAbstract.dtypes�s���y�y���r$c�.�|jjS)r?)r�r@r:s r"r@z"_TableBuilderAbstract.dtype_counts�s���y�y�%�%�%r$c�@�t|jj�S)z Whether to display memory usage.)r�r�r2r:s r"�display_memory_usagez*_TableBuilderAbstract.display_memory_usage�s���D�I�I�*�*�+�+r$c�.�|jjS)z/Memory usage string with proper size qualifier.)r�rHr:s r"rHz)_TableBuilderAbstract.memory_usage_string�s���y�y�,�,�,r$c�.�|jjSrP)r�rCr:s r"rCz%_TableBuilderAbstract.non_null_counts�s���y�y�(�(�(r$c�r�|jjtt|j���y)z>Add line with string representation of dataframe to the table.N)r��appendr�typer7r:s r"�add_object_type_linez*_TableBuilderAbstract.add_object_type_line�s!�������3�t�D�I�I��/�0r$c�~�|jj|jjj	��y)z,Add line with range of indices to the table.N)r�r�r7rM�_summaryr:s r"�add_index_range_linez*_TableBuilderAbstract.add_index_range_line�s%�������4�9�9�?�?�3�3�5�6r$c���t|jj��D��cgc]\}}|�d|d�d���}}}|jj	ddj|����ycc}}w)z2Add summary line with dtypes present in dataframe.�(�d�)zdtypes: z, N)�sortedr@�itemsr�r��join)r;�key�val�collected_dtypess    r"�add_dtypes_linez%_TableBuilderAbstract.add_dtypes_line�ss��/5�T�5F�5F�5L�5L�5N�.O�
�.O�(�#�s�s�e�1�S��G�1��.O�	�
�	
�����X�d�i�i�0@�&A�%B�C�D��
s�A+N�rWr�)rWr6rVrXr�r^rZ�rWrc)rdrerfrgrhrr�rir7r<r@r�rHrCr�r�r�r,r$r"r�r��s����
��
�O��<��<������ �� ��&��&��,��,��-��-��)��)�1�7�Er$r�c�x�eZdZdZdd�Zdd�Zd
d�Zed
d��Ze	dd��Z
e	dd��Ze	dd��Zd
d	�Z
y
)r�z�
    Abstract builder for dataframe info table.

    Parameters
    ----------
    info : DataFrameInfo.
        Instance of DataFrameInfo.
    c��||_yrPr��r;r�s  r"roz_DataFrameTableBuilder.__init__s	��#'��	r$c��g|_|jdk(r|j�|jS|j�|jS)Nr)r�rz�_fill_empty_info�_fill_non_empty_infor:s r"r�z _DataFrameTableBuilder.get_linessE������>�>�Q���!�!�#��{�{��
�%�%�'��{�{�r$c��|j�|j�|jjdt	|j
�j�d��y)z;Add lines to the info table, pertaining to empty dataframe.zEmpty rGN)r�r�r�r�r�r7rdr:s r"r�z'_DataFrameTableBuilder._fill_empty_infosD���!�!�#��!�!�#������V�D����O�$<�$<�#=�R�@�Ar$c��y�z?Add lines to the info table, pertaining to non-empty dataframe.Nr,r:s r"r�z+_DataFrameTableBuilder._fill_non_empty_infor=r$c�.�|jjS)z
DataFrame.r�r:s r"r7z_DataFrameTableBuilder.data#����y�y�~�~�r$c�.�|jjS)zDataframe columns.)r�rvr:s r"rvz_DataFrameTableBuilder.ids(s���y�y�}�}�r$c�.�|jjS)z-Number of dataframe columns to be summarized.r�r:s r"rzz _DataFrameTableBuilder.col_count-r�r$c�T�|jjd|j���y�z!Add line containing memory usage.zmemory usage: N�r�r�rHr:s r"�add_memory_usage_linez,_DataFrameTableBuilder.add_memory_usage_line2�"�������^�D�,D�,D�+E�F�Gr$N)r�rkrWrcr�r�)rWrr�r\)rdrerfrgror�r�rr�rir7rvrzr�r,r$r"r�r�so���(��B��N��N����������#��#�Hr$r�c� �eZdZdZdd�Zdd�Zy)r�z>
    Dataframe info table builder for non-verbose output.
    c��|j�|j�|j�|j�|jr|j�yyr�)r�r��add_columns_summary_liner�r�r�r:s r"r�z5_DataFrameTableBuilderNonVerbose._fill_non_empty_info<sL���!�!�#��!�!�#��%�%�'������$�$��&�&�(�%r$c�n�|jj|jjd���y)N�Columns��name)r�r�rvr�r:s r"r�z9_DataFrameTableBuilderNonVerbose.add_columns_summary_lineEs&�������4�8�8�,�,�)�,�<�=r$Nr�)rdrerfrgr�r�r,r$r"r�r�7s���)�>r$r�c���eZdZUdZdZded<ded<ded<d	ed
<eedd���Zedd��Z	dd
�Z
dd�Zdd�Zedd��Z
edd��Zdd�Zdd�Zdd�Zdd�Zdd�Zy)�_TableBuilderVerboseMixinz(
    Mixin for verbose info output.
    z  r�SPACINGzSequence[Sequence[str]]�strrowsr[�gross_column_widthsr�r�c��y)�.Headers names of the columns in verbose table.Nr,r:s r"�headersz!_TableBuilderVerboseMixin.headersSr=r$c�R�|jD�cgc]
}t|���c}Scc}w)z'Widths of header columns (only titles).)rry�r;�cols  r"�header_column_widthsz._TableBuilderVerboseMixin.header_column_widthsXs$��%)�L�L�1�L�S��C��L�1�1��1s�$c��|j�}t|j|�D�cgc]
}t|���c}Scc}w)zAGet widths of columns containing both headers and actual content.)�_get_body_column_widths�zipr�max)r;�body_column_widths�widthss   r"�_get_gross_column_widthsz2_TableBuilderVerboseMixin._get_gross_column_widths]sJ��!�9�9�;���d�7�7�9K�L�
�L��
��L�L�
�	
��
s�;c��tt|j��}|D�cgc]}td�|D����c}Scc}w)z$Get widths of table content columns.c3�2K�|]}t|����y�wrP)ry)�.0r/s  r"�	<genexpr>zD_TableBuilderVerboseMixin._get_body_column_widths.<locals>.<genexpr>hs����(�C�q�C��F�C�s�)�listrrr)r;�strcolsrs   r"r
z1_TableBuilderVerboseMixin._get_body_column_widthses8��+/��T�\�\�0B�+C��4;�<�G�S��(�C�(�(�G�<�<��<s�<c�Z�|jr|j�S|j�S)z�
        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_rowsz#_TableBuilderVerboseMixin._gen_rowsjs+������-�-�/�/��0�0�2�2r$c��y�z=Iterator with string representation of body data with counts.Nr,r:s r"rz/_TableBuilderVerboseMixin._gen_rows_with_countsur=r$c��y�z@Iterator with string representation of body data without counts.Nr,r:s r"rz2_TableBuilderVerboseMixin._gen_rows_without_countsyr=r$c
���|jjt|j|j�D��cgc]\}}t||���c}}�}|jj|�ycc}}wrP)r�r�rrrr#r�r�)r;�header�	col_width�header_lines    r"�add_header_linez)_TableBuilderVerboseMixin.add_header_line}si���l�l�'�'�*-�T�\�\�4�;S�;S�)T�
�)T�%�F�I����+�)T�
�
��	
�����;�'��
s�A3
c
��|jjt|j|j�D��cgc]\}}td|z|���c}}�}|jj|�ycc}}w)N�-)r�r�rrrr#r�r�)r;�header_colwidth�gross_colwidth�separator_lines    r"�add_separator_linez,_TableBuilderVerboseMixin.add_separator_line�sw�����*�*�8;��-�-�t�/G�/G�8�
�8�3�O�^����.��?�8�
�
��	
�����>�*��
s�A6
c��|jD]i}|jjt||j�D��cgc]\}}t||���c}}�}|jj|��kycc}}wrP)rr�r�rrr#r�r�)r;�rowrr&�	body_lines     r"�add_body_linesz(_TableBuilderVerboseMixin.add_body_lines�ss���<�<�C����)�)�03�3��8P�8P�/Q��/Q�+��^��S�.�1�/Q���I�
�K�K���y�)� ��s�A:c#�<K�|jD]	}|�d����y�w)z7Iterator with string representation of non-null counts.z	 non-nullN)rC)r;r}s  r"�_gen_non_null_countsz._TableBuilderVerboseMixin._gen_non_null_counts�s#�����)�)�E��G�9�%�%�*�s�c#�HK�|jD]}t|����y�w)z5Iterator with string representation of column dtypes.N)r<r)r;�dtypes  r"�_gen_dtypesz%_TableBuilderVerboseMixin._gen_dtypes�s�����[�[�E��u�%�%�!��� "N�rWz
Sequence[str]rZ�rWzIterator[Sequence[str]]r��rWz
Iterator[str])rdrerfrgr�rhrirrrrr
rrrr"r(r,r.r1r,r$r"r�r�Is�����G�S��
$�$�&�&���
��=���=��2��2�
�=�
	3��L��L��O��O�(�	+�*�&�
&r$r�c�f�eZdZdZ						dd�Zdd�Zed
d��Zdd�Zdd�Z	dd�Z
dd�Zdd	�Zy
)r�z:
    Dataframe info table builder for verbose output.
    c��||_||_t|j��|_|j�|_yrP�r�r�rrrrr�r;r�r�s   r"roz&_DataFrameTableBuilderVerbose.__init__��7����	�&���04�T�^�^�5E�0F���26�2O�2O�2Q�� r$c��|j�|j�|j�|j�|j	�|j�|j
�|jr|j�yyr�)	r�r�r�r"r(r,r�r�r�r:s r"r�z2_DataFrameTableBuilderVerbose._fill_non_empty_info�sp���!�!�#��!�!�#��%�%�'��������!����������$�$��&�&�(�%r$c�*�|jrgd�Sgd�S)r)� # �Column�Non-Null Countr)r=r>r�r�r:s r"rz%_DataFrameTableBuilderVerbose.headers�s�����?�?�)�)r$c�V�|jjd|j�d��y)NzData columns (total z
 columns):)r�r�rzr:s r"r�z6_DataFrameTableBuilderVerbose.add_columns_summary_line�s#�������1�$�.�.�1A��L�Mr$c#�K�t|j�|j�|j��Ed{���y7��wr)r�_gen_line_numbers�_gen_columnsr1r:s r"rz6_DataFrameTableBuilderVerbose._gen_rows_without_counts�s<������"�"�$���������
�	
�	
�s�;A�A�Ac#�K�t|j�|j�|j�|j	��Ed{���y7��wr)rrCrDr.r1r:s r"rz3_DataFrameTableBuilderVerbose._gen_rows_with_counts�sH������"�"�$������%�%�'�����	
�	
�	
�s�A
A�A�
Ac#�TK�t|j�D]\}}d|�����y�w)z6Iterator with string representation of column numbers.r+N)�	enumeraterv)r;�i�_s   r"rCz/_DataFrameTableBuilderVerbose._gen_line_numbers�s(�����d�h�h�'�D�A�q��a�S�'�M�(�s�&(c#�HK�|jD]}t|����y�w)z4Iterator with string representation of column names.N)rvrrs  r"rDz*_DataFrameTableBuilderVerbose._gen_columns�s�����8�8�C��s�#�#��r2N)r�rkr�r�rWrcr�r3r4r5)
rdrerfrgror�rirr�rrrCrDr,r$r"r�r��sa���	R��	R��		R�

�	R�
)��*��*�N�
�
��
$r$r�c�L�eZdZdZdd�Zd	d�Zed
d��Zdd�Ze	dd��Z
y)r�z�
    Abstract builder for series info table.

    Parameters
    ----------
    info : SeriesInfo.
        Instance of SeriesInfo.
    c��||_yrPr�r�s  r"roz_SeriesTableBuilder.__init__�s	�� $��	r$c�H�g|_|j�|jSrP)r�r�r:s r"r�z_SeriesTableBuilder.get_lines�s������!�!�#��{�{�r$c�.�|jjS)zSeries.r�r:s r"r7z_SeriesTableBuilder.data�r�r$c�T�|jjd|j���yr�r�r:s r"r�z)_SeriesTableBuilder.add_memory_usage_line�r�r$c��y�z<Add lines to the info table, pertaining to non-empty series.Nr,r:s r"r�z(_SeriesTableBuilder._fill_non_empty_infor=r$N)r�r�rWrcr�)rWrr�)rdrerfrgror�rir7r�rr�r,r$r"r�r��sA���%��
����H��K��Kr$r�c��eZdZdZdd�Zy)r�z;
    Series info table builder for non-verbose output.
    c��|j�|j�|j�|jr|j	�yyrQ)r�r�r�r�r�r:s r"r�z2_SeriesTableBuilderNonVerbose._fill_non_empty_info
s@���!�!�#��!�!�#������$�$��&�&�(�%r$Nr�)rdrerfrgr�r,r$r"r�r�s���)r$r�c�V�eZdZdZ						d	d�Zd
d�Zd
d�Zedd��Zdd�Z	dd�Z
y)
r�z7
    Series info table builder for verbose output.
    c��||_||_t|j��|_|j�|_yrPr8r9s   r"roz#_SeriesTableBuilderVerbose.__init__r:r$c��|j�|j�|j�|j�|j	�|j�|j
�|jr|j�yyrQ)	r�r��add_series_name_liner"r(r,r�r�r�r:s r"r�z/_SeriesTableBuilderVerbose._fill_non_empty_info&sp���!�!�#��!�!�#��!�!�#��������!����������$�$��&�&�(�%r$c�h�|jjd|jj���y)Nz
Series name: )r�r�r7r�r:s r"rWz/_SeriesTableBuilderVerbose.add_series_name_line2s$�������]�4�9�9�>�>�*:�;�<r$c�(�|jrddgSdgS)rr?rr@r:s r"rz"_SeriesTableBuilderVerbose.headers5s �����$�g�.�.��y�r$c#�@K�|j�Ed{���y7��wr)r1r:s r"rz3_SeriesTableBuilderVerbose._gen_rows_without_counts<s�����#�#�%�%�%�s���c#�pK�t|j�|j��Ed{���y7��wr)rr.r1r:s r"rz0_SeriesTableBuilderVerbose._gen_rows_with_counts@s0������%�%�'�����
�	
�	
�s�,6�4�6N)r�r�r�r�rWrcr�r3r4)rdrerfrgror�rWrirrrr,r$r"r�r�sV���	R��	R��		R�

�	R�
)�=�����&�
r$r�c�r�|jj�jd��j�S)zK
    Create mapping between datatypes and their number of occurrences.
    c��|jSrPr�)r/s r"�<lambda>z-_get_dataframe_dtype_counts.<locals>.<lambda>Ms��a�f�fr$)r<�value_counts�groupbyr�)�dfs r"rqrqHs,��
�9�9�!�!�#�+�+�,<�=�A�A�C�Cr$)r zstr | Dtyper!r]rWr)r-�floatr.rrWrrP)r2r�rWr8)rarrWrY)8�
__future__r�abcrrr��textwrapr�typingr�pandas._configr	�pandas.io.formatsr
r��pandas.io.formats.printingr�collections.abcrr
rr�pandas._typingrr�pandasrrr�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#r0r3r5rkr�r�r�r�r�r�r�r�r�r�r�r�rqr,r$r"�<module>rus���"���� �%�+�3�����
���@����?����Q�S��l�B�����&�&�&�&�����9�;��|�4������&�'�'�6����.�0��f'�4,�@'+��#����P
��P
�fF�I�F�R9=��9=�x0�0�$M�0�M�`(�-�(�V5E�C�5E�p0H�2�0H�f>�'=�>�$Z&� 5�Z&�z?$�$:�<U�?$�DK�/�K�@)�$7�)�/
�!4�6O�/
�dDr$

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists