a
    oÝEb¼  ã                   @   s  d Z ddlmZ ddlmZmZ G dd„ deƒZG dd„ deƒZG dd	„ d	e	ƒZ
G d
d„ deƒZG dd„ deƒZG dd„ deƒZG dd„ de	ƒZG dd„ deƒZG dd„ de	ƒZG dd„ deƒZG dd„ de	ƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG d d!„ d!eƒZd"S )#z%
Expose public exceptions & warnings
é    )ÚOptionError)ÚOutOfBoundsDatetimeÚOutOfBoundsTimedeltac                   @   s   e Zd ZdZdS )ÚIntCastingNaNErrorzb
    Raised when attempting an astype operation on an array with NaN to an integer
    dtype.
    N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   úV/home/ja/django-apps/lartica_env/lib/python3.9/site-packages/pandas/errors/__init__.pyr      s   r   c                   @   s   e Zd ZdZdS )ÚNullFrequencyErrorzÅ
    Error raised when a null `freq` attribute is used in an operation
    that needs a non-null frequency, particularly `DatetimeIndex.shift`,
    `TimedeltaIndex.shift`, `PeriodIndex.shift`.
    Nr   r   r   r   r   r      s   r   c                   @   s   e Zd ZdZdS )ÚPerformanceWarningzE
    Warning raised when there is a possible performance impact.
    Nr   r   r   r   r   r       s   r   c                   @   s   e Zd ZdZdS )ÚUnsupportedFunctionCallz´
    Exception raised when attempting to call a numpy function
    on a pandas object, but that function is not supported by
    the object e.g. ``np.cumsum(groupby_object)``.
    Nr   r   r   r   r   r   &   s   r   c                   @   s   e Zd ZdZdS )ÚUnsortedIndexErrorzˆ
    Error raised when attempting to get a slice of a MultiIndex,
    and the index has not been lexsorted. Subclass of `KeyError`.
    Nr   r   r   r   r   r   .   s   r   c                   @   s   e Zd ZdZdS )ÚParserErrorao  
    Exception that is raised by an error encountered in parsing file contents.

    This is a generic error raised for errors encountered when functions like
    `read_csv` or `read_html` are parsing contents of a file.

    See Also
    --------
    read_csv : Read CSV (comma-separated) file into a DataFrame.
    read_html : Read HTML table into a DataFrame.
    Nr   r   r   r   r   r   5   s   r   c                   @   s   e Zd ZdZdS )ÚDtypeWarninga  
    Warning raised when reading different dtypes in a column from a file.

    Raised for a dtype incompatibility. This can happen whenever `read_csv`
    or `read_table` encounter non-uniform dtypes in a column(s) of a given
    CSV file.

    See Also
    --------
    read_csv : Read CSV (comma-separated) file into a DataFrame.
    read_table : Read general delimited file into a DataFrame.

    Notes
    -----
    This warning is issued when dealing with larger files because the dtype
    checking happens per chunk read.

    Despite the warning, the CSV file is read with mixed types in a single
    column which will be an object type. See the examples below to better
    understand this issue.

    Examples
    --------
    This example creates and reads a large CSV file with a column that contains
    `int` and `str`.

    >>> df = pd.DataFrame({'a': (['1'] * 100000 + ['X'] * 100000 +
    ...                          ['1'] * 100000),
    ...                    'b': ['b'] * 300000})  # doctest: +SKIP
    >>> df.to_csv('test.csv', index=False)  # doctest: +SKIP
    >>> df2 = pd.read_csv('test.csv')  # doctest: +SKIP
    ... # DtypeWarning: Columns (0) have mixed types

    Important to notice that ``df2`` will contain both `str` and `int` for the
    same input, '1'.

    >>> df2.iloc[262140, 0]  # doctest: +SKIP
    '1'
    >>> type(df2.iloc[262140, 0])  # doctest: +SKIP
    <class 'str'>
    >>> df2.iloc[262150, 0]  # doctest: +SKIP
    1
    >>> type(df2.iloc[262150, 0])  # doctest: +SKIP
    <class 'int'>

    One way to solve this issue is using the `dtype` parameter in the
    `read_csv` and `read_table` functions to explicit the conversion:

    >>> df2 = pd.read_csv('test.csv', sep=',', dtype={'a': str})  # doctest: +SKIP

    No warning was issued.
    Nr   r   r   r   r   r   C   s   r   c                   @   s   e Zd ZdZdS )ÚEmptyDataErrorz„
    Exception that is thrown in `pd.read_csv` (by both the C and
    Python engines) when empty data or header is encountered.
    Nr   r   r   r   r   r   z   s   r   c                   @   s   e Zd ZdZdS )ÚParserWarninga9  
    Warning raised when reading a file that doesn't use the default 'c' parser.

    Raised by `pd.read_csv` and `pd.read_table` when it is necessary to change
    parsers, generally from the default 'c' parser to 'python'.

    It happens due to a lack of support or functionality for parsing a
    particular attribute of a CSV file with the requested engine.

    Currently, 'c' unsupported options include the following parameters:

    1. `sep` other than a single character (e.g. regex separators)
    2. `skipfooter` higher than 0
    3. `sep=None` with `delim_whitespace=False`

    The warning can be avoided by adding `engine='python'` as a parameter in
    `pd.read_csv` and `pd.read_table` methods.

    See Also
    --------
    pd.read_csv : Read CSV (comma-separated) file into DataFrame.
    pd.read_table : Read general delimited file into DataFrame.

    Examples
    --------
    Using a `sep` in `pd.read_csv` other than a single character:

    >>> import io
    >>> csv = '''a;b;c
    ...           1;1,8
    ...           1;2,1'''
    >>> df = pd.read_csv(io.StringIO(csv), sep='[;,]')  # doctest: +SKIP
    ... # ParserWarning: Falling back to the 'python' engine...

    Adding `engine='python'` to `pd.read_csv` removes the Warning:

    >>> df = pd.read_csv(io.StringIO(csv), sep='[;,]', engine='python')
    Nr   r   r   r   r   r   �   s   r   c                   @   s   e Zd ZdZdS )Ú
MergeErrorzx
    Error raised when problems arise during merging due to problems
    with input data. Subclass of `ValueError`.
    Nr   r   r   r   r   r   ª   s   r   c                   @   s   e Zd ZdZdS )ÚAccessorRegistrationWarningzC
    Warning for attribute conflicts in accessor registration.
    Nr   r   r   r   r   r   ±   s   r   c                   @   s(   e Zd ZdZd	dd„Zedœdd„ZdS )
ÚAbstractMethodErrorzŠ
    Raise this error instead of NotImplementedError for abstract methods
    while keeping compatibility with Python 2 and Python 3.
    Úmethodc                 C   s6   h d£}||vr&t d|› d|› d�ƒ‚|| _|| _d S )N>   Úpropertyr   ÚclassmethodÚstaticmethodzmethodtype must be one of z, got z	 instead.)Ú
ValueErrorÚ
methodtypeÚclass_instance)Úselfr   r   Útypesr   r   r   Ú__init__½   s    ÿzAbstractMethodError.__init__)Úreturnc                 C   s2   | j dkr| jj}nt| jƒj}d| j › d|› �S )Nr   zThis z' must be defined in the concrete class )r   r   r   Útype)r   Únamer   r   r   Ú__str__Æ   s    

zAbstractMethodError.__str__N)r   )r   r   r	   r
   r!   Ústrr%   r   r   r   r   r   ·   s   
	r   c                   @   s   e Zd ZdZdS )ÚNumbaUtilErrorz=
    Error raised for unsupported Numba engine routines.
    Nr   r   r   r   r   r'   Î   s   r'   c                   @   s   e Zd ZdZdS )ÚDuplicateLabelErrora¯  
    Error raised when an operation would introduce duplicate labels.

    .. versionadded:: 1.2.0

    Examples
    --------
    >>> s = pd.Series([0, 1, 2], index=['a', 'b', 'c']).set_flags(
    ...     allows_duplicate_labels=False
    ... )
    >>> s.reindex(['a', 'a', 'b'])
    Traceback (most recent call last):
       ...
    DuplicateLabelError: Index has duplicates.
          positions
    label
    a        [0, 1]
    Nr   r   r   r   r   r(   Ô   s   r(   c                   @   s   e Zd ZdZdS )ÚInvalidIndexErrorzd
    Exception raised when attempting to use an invalid index key.

    .. versionadded:: 1.1.0
    Nr   r   r   r   r   r)   é   s   r)   N)r
   Zpandas._config.configr   Zpandas._libs.tslibsr   r   r   r   r   ÚWarningr   r   ÚKeyErrorr   r   r   r   r   r   r   ÚNotImplementedErrorr   Ú	Exceptionr'   r(   r)   r   r   r   r   Ú<module>   s"   	
7)