o
    dZK                     @  s  d Z ddlmZ ddlZddlmZ ddlmZmZ ddl	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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/Z$G d0d1 d1e%Z&G d2d3 d3e%Z'G d4d5 d5eZ(G d6d7 d7e)Z*G d8d9 d9e*Z+G d:d; d;e,Z-G d<d= d=eZ.G d>d? d?eZ/G d@dA dAeZ0G dBdC dCeZ1G dDdE dEe2Z3G dFdG dGeZ4G dHdI dIeZ5G dJdK dKeZ6G dLdM dMeZ7G dNdO dOeZ8G dPdQ dQeZ9G dRdS dSeZ:g dTZ;dS )Uz%
Expose public exceptions & warnings
    )annotationsN)OptionError)OutOfBoundsDatetimeOutOfBoundsTimedelta)InvalidVersionc                   @     e Zd ZdZdS )IntCastingNaNErrorz]
    Exception raised when converting (``astype``) an array with NaN to an integer type.
    N__name__
__module____qualname____doc__ r   r   [/var/www/html/visualizacion-main/env/lib/python3.10/site-packages/pandas/errors/__init__.pyr          r   c                   @  r   )NullFrequencyErrorz
    Exception raised when a ``freq`` cannot be null.

    Particularly ``DatetimeIndex.shift``, ``TimedeltaIndex.shift``,
    ``PeriodIndex.shift``.
    Nr	   r   r   r   r   r      r   r   c                   @  r   )PerformanceWarningzE
    Warning raised when there is a possible performance impact.
    Nr	   r   r   r   r   r   !   r   r   c                   @  r   )UnsupportedFunctionCallz
    Exception raised when attempting to call a unsupported numpy function.

    For example, ``np.cumsum(groupby_object)``.
    Nr	   r   r   r   r   r   '   r   r   c                   @  r   )UnsortedIndexErrorzk
    Error raised when slicing a MultiIndex which has not been lexsorted.

    Subclass of `KeyError`.
    Nr	   r   r   r   r   r   /   r   r   c                   @  r   )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   7   r   r   c                   @  r   )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   E   r   r   c                   @  r   )EmptyDataErrorzW
    Exception raised in ``pd.read_csv`` when empty data or header is encountered.
    Nr	   r   r   r   r   r   |   r   r   c                   @  r   )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      r   r   c                   @  r   )
MergeErrorzN
    Exception raised when merging data.

    Subclass of ``ValueError``.
    Nr	   r   r   r   r   r      r   r   c                   @  r   )AccessorRegistrationWarningzC
    Warning for attribute conflicts in accessor registration.
    Nr	   r   r   r   r   r      r   r   c                   @  s&   e Zd ZdZddddZdd	d
ZdS )AbstractMethodErrorzO
    Raise this error instead of NotImplementedError for abstract methods.
    method
methodtypestrreturnNonec                 C  s6   h d}||vrt d| d| d|| _|| _d S )N>   r   propertyclassmethodstaticmethodzmethodtype must be one of z, got z	 instead.)
ValueErrorr   class_instance)selfr%   r   typesr   r   r   __init__   s   
zAbstractMethodError.__init__c                 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   r   )r
   r   r   r   r(   r+   r   r   r   r   r      s    	r   c                   @  r   )NumbaUtilErrorz=
    Error raised for unsupported Numba engine routines.
    Nr	   r   r   r   r   r,      r   r,   c                   @  r   )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-      r   r-   c                   @  r   )InvalidIndexErrorzd
    Exception raised when attempting to use an invalid index key.

    .. versionadded:: 1.1.0
    Nr	   r   r   r   r   r.      r   r.   c                   @  r   )	DataErrorz
    Exceptionn raised when performing an operation on non-numerical data.

    For example, calling ``ohlc`` on a non-numerical column or a function
    on a rolling window.
    Nr	   r   r   r   r   r/      r   r/   c                   @  r   )SpecificationErrora  
    Exception raised by ``agg`` when the functions are ill-specified.

    The exception raised in two scenarios.

    The first way is calling ``agg`` on a
    Dataframe or Series using a nested renamer (dict-of-dict).

    The second way is calling ``agg`` on a Dataframe with duplicated functions
    names without assigning column name.

    Examples
    --------
    >>> df = pd.DataFrame({'A': [1, 1, 1, 2, 2],
    ...                    'B': range(5),
    ...                    'C': range(5)})
    >>> df.groupby('A').B.agg({'foo': 'count'}) # doctest: +SKIP
    ... # SpecificationError: nested renamer is not supported

    >>> df.groupby('A').agg({'B': {'foo': ['sum', 'max']}}) # doctest: +SKIP
    ... # SpecificationError: nested renamer is not supported

    >>> df.groupby('A').agg(['min', 'min']) # doctest: +SKIP
    ... # SpecificationError: nested renamer is not supported
    Nr	   r   r   r   r   r0      r   r0   c                   @  r   )SettingWithCopyErrora  
    Exception raised when trying to set on a copied slice from a ``DataFrame``.

    The ``mode.chained_assignment`` needs to be set to set to 'raise.' This can
    happen unintentionally when chained indexing.

    For more information on evaluation order,
    see :ref:`the user guide<indexing.evaluation_order>`.

    For more information on view vs. copy,
    see :ref:`the user guide<indexing.view_versus_copy>`.

    Examples
    --------
    >>> pd.options.mode.chained_assignment = 'raise'
    >>> df = pd.DataFrame({'A': [1, 1, 1, 2, 2]}, columns=['A'])
    >>> df.loc[0:3]['A'] = 'a' # doctest: +SKIP
    ... # SettingWithCopyError: A value is trying to be set on a copy of a...
    Nr	   r   r   r   r   r1     r   r1   c                   @  r   )SettingWithCopyWarninga  
    Warning raised when trying to set on a copied slice from a ``DataFrame``.

    The ``mode.chained_assignment`` needs to be set to set to 'warn.'
    'Warn' is the default option. This can happen unintentionally when
    chained indexing.

    For more information on evaluation order,
    see :ref:`the user guide<indexing.evaluation_order>`.

    For more information on view vs. copy,
    see :ref:`the user guide<indexing.view_versus_copy>`.

    Examples
    --------
    >>> df = pd.DataFrame({'A': [1, 1, 1, 2, 2]}, columns=['A'])
    >>> df.loc[0:3]['A'] = 'a' # doctest: +SKIP
    ... # SettingWithCopyWarning: A value is trying to be set on a copy of a...
    Nr	   r   r   r   r   r2   -  r   r2   c                   @  r   )ChainedAssignmentErrora  
    Warning raised when trying to set using chained assignment.

    When the ``mode.copy_on_write`` option is enabled, chained assignment can
    never work. In such a situation, we are always setting into a temporary
    object that is the result of an indexing operation (getitem), which under
    Copy-on-Write always behaves as a copy. Thus, assigning through a chain
    can never update the original Series or DataFrame.

    For more information on view vs. copy,
    see :ref:`the user guide<indexing.view_versus_copy>`.

    Examples
    --------
    >>> pd.options.mode.copy_on_write = True
    >>> df = pd.DataFrame({'A': [1, 1, 1, 2, 2]}, columns=['A'])
    >>> df["A"][0:3] = 10 # doctest: +SKIP
    ... # ChainedAssignmentError: ...
    >>> pd.options.mode.copy_on_write = False
    Nr	   r   r   r   r   r3   C  r   r3   a  A value is trying to be set on a copy of a DataFrame or Series through chained assignment.
When using the Copy-on-Write mode, such chained assignment never works to update the original DataFrame or Series, because the intermediate object on which we are setting values always behaves as a copy.

Try using '.loc[row_indexer, col_indexer] = value' instead, to perform the assignment in a single step.

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copyc                   @  r   )NumExprClobberingErrora  
    Exception raised when trying to use a built-in numexpr name as a variable name.

    ``eval`` or ``query`` will throw the error if the engine is set
    to 'numexpr'. 'numexpr' is the default engine value for these methods if the
    numexpr package is installed.

    Examples
    --------
    >>> df = pd.DataFrame({'abs': [1, 1, 1]})
    >>> df.query("abs > 2") # doctest: +SKIP
    ... # NumExprClobberingError: Variables in expression "(abs) > (2)" overlap...
    >>> sin, a = 1, 2
    >>> pd.eval("sin + a", engine='numexpr') # doctest: +SKIP
    ... # NumExprClobberingError: Variables in expression "(sin) + (a)" overlap...
    Nr	   r   r   r   r   r4   h  r   r4   c                      s$   e Zd ZdZdd fd	d
Z  ZS )UndefinedVariableErrora$  
    Exception raised by ``query`` or ``eval`` when using an undefined variable name.

    It will also specify whether the undefined variable is local or not.

    Examples
    --------
    >>> df = pd.DataFrame({'A': [1, 1, 1]})
    >>> df.query("A > x") # doctest: +SKIP
    ... # UndefinedVariableError: name 'x' is not defined
    >>> df.query("A > @y") # doctest: +SKIP
    ... # UndefinedVariableError: local variable 'y' is not defined
    >>> pd.eval('x + 1') # doctest: +SKIP
    ... # UndefinedVariableError: name 'x' is not defined
    Nr*   r   is_localbool | Noner   r    c                   s8   t | d}|rd| }nd| }t | d S )Nz is not definedzlocal variable zname )reprsuperr(   )r&   r*   r6   base_msgmsg	__class__r   r   r(     s
   
zUndefinedVariableError.__init__)N)r*   r   r6   r7   r   r    r
   r   r   r   r(   __classcell__r   r   r<   r   r5   {  s    r5   c                   @  r   )IndexingErrora  
    Exception is raised when trying to index and there is a mismatch in dimensions.

    Examples
    --------
    >>> df = pd.DataFrame({'A': [1, 1, 1]})
    >>> df.loc[..., ..., 'A'] # doctest: +SKIP
    ... # IndexingError: indexer may only contain one '...' entry
    >>> df = pd.DataFrame({'A': [1, 1, 1]})
    >>> df.loc[1, ..., ...] # doctest: +SKIP
    ... # IndexingError: Too many indexers
    >>> df[pd.Series([True], dtype=bool)] # doctest: +SKIP
    ... # IndexingError: Unalignable boolean Series provided as indexer...
    >>> s = pd.Series(range(2),
    ...               index = pd.MultiIndex.from_product([["a", "b"], ["c"]]))
    >>> s.loc["a", "c", "d"] # doctest: +SKIP
    ... # IndexingError: Too many indexers
    Nr	   r   r   r   r   r@     r   r@   c                   @  r   )PyperclipExceptionz
    Exception raised when clipboard functionality is unsupported.

    Raised by ``to_clipboard()`` and ``read_clipboard()``.
    Nr	   r   r   r   r   rA     r   rA   c                      s"   e Zd ZdZd fddZ  ZS )	PyperclipWindowsExceptionz
    Exception raised when clipboard functionality is unsupported by Windows.

    Access to the clipboard handle would be denied due to some other
    window process is accessing it.
    messager   r   r    c                   s$   |dt   d7 }t | d S )Nz ())ctypesWinErrorr9   r(   )r&   rC   r<   r   r   r(     s   z"PyperclipWindowsException.__init__)rC   r   r   r    r>   r   r   r<   r   rB     s    rB   c                   @  r   )
CSSWarninga  
    Warning is raised when converting css styling fails.

    This can be due to the styling not having an equivalent value or because the
    styling isn't properly formatted.

    Examples
    --------
    >>> df = pd.DataFrame({'A': [1, 1, 1]})
    >>> (df.style.applymap(lambda x: 'background-color: blueGreenRed;')
    ...         .to_excel('styled.xlsx')) # doctest: +SKIP
    ... # CSSWarning: Unhandled color format: 'blueGreenRed'
    >>> (df.style.applymap(lambda x: 'border: 1px solid red red;')
    ...         .to_excel('styled.xlsx')) # doctest: +SKIP
    ... # CSSWarning: Too many tokens provided to "border" (expected 1-3)
    Nr	   r   r   r   r   rG     r   rG   c                   @  r   )PossibleDataLossErrora&  
    Exception raised when trying to open a HDFStore file when already opened.

    Examples
    --------
    >>> store = pd.HDFStore('my-store', 'a') # doctest: +SKIP
    >>> store.open("w") # doctest: +SKIP
    ... # PossibleDataLossError: Re-opening the file [my-store] with mode [a]...
    Nr	   r   r   r   r   rH     r   rH   c                   @  r   )ClosedFileErrora8  
    Exception is raised when trying to perform an operation on a closed HDFStore file.

    Examples
    --------
    >>> store = pd.HDFStore('my-store', 'a') # doctest: +SKIP
    >>> store.close() # doctest: +SKIP
    >>> store.keys() # doctest: +SKIP
    ... # ClosedFileError: my-store file is not open!
    Nr	   r   r   r   r   rI     r   rI   c                   @  r   )IncompatibilityWarningzX
    Warning raised when trying to use where criteria on an incompatible HDF5 file.
    Nr	   r   r   r   r   rJ     r   rJ   c                   @  r   )AttributeConflictWarninga$  
    Warning raised when index attributes conflict when using HDFStore.

    Occurs when attempting to append an index with a different
    name than the existing index on an HDFStore or attempting to append an index with a
    different frequency than the existing index on an HDFStore.
    Nr	   r   r   r   r   rK     r   rK   c                   @  r   )DatabaseErroraJ  
    Error is raised when executing sql with bad syntax or sql that throws an error.

    Examples
    --------
    >>> from sqlite3 import connect
    >>> conn = connect(':memory:')
    >>> pd.read_sql('select * test', conn) # doctest: +SKIP
    ... # DatabaseError: Execution failed on sql 'test': near "test": syntax error
    Nr	   r   r   r   r   rL     r   rL   c                   @  r   )PossiblePrecisionLossa  
    Warning raised by to_stata on a column with a value outside or equal to int64.

    When the column value is outside or equal to the int64 value the column is
    converted to a float64 dtype.

    Examples
    --------
    >>> df = pd.DataFrame({"s": pd.Series([1, 2**53], dtype=np.int64)})
    >>> df.to_stata('test') # doctest: +SKIP
    ... # PossiblePrecisionLoss: Column converted from int64 to float64...
    Nr	   r   r   r   r   rM   	  r   rM   c                   @  r   )ValueLabelTypeMismatchaK  
    Warning raised by to_stata on a category column that contains non-string values.

    Examples
    --------
    >>> df = pd.DataFrame({"categories": pd.Series(["a", 2], dtype="category")})
    >>> df.to_stata('test') # doctest: +SKIP
    ... # ValueLabelTypeMismatch: Stata value labels (pandas categories) must be str...
    Nr	   r   r   r   r   rN     r   rN   c                   @  r   )InvalidColumnNamea  
    Warning raised by to_stata the column contains a non-valid stata name.

    Because the column name is an invalid Stata variable, the name needs to be
    converted.

    Examples
    --------
    >>> df = pd.DataFrame({"0categories": pd.Series([2, 2])})
    >>> df.to_stata('test') # doctest: +SKIP
    ... # InvalidColumnName: Not all pandas column names were valid Stata variable...
    Nr	   r   r   r   r   rO   $  r   rO   c                   @  r   )CategoricalConversionWarninga  
    Warning is raised when reading a partial labeled Stata file using a iterator.

    Examples
    --------
    >>> from pandas.io.stata import StataReader
    >>> with StataReader('dta_file', chunksize=2) as reader: # doctest: +SKIP
    ...   for i, block in enumerate(reader):
    ...      print(i, block)
    ... # CategoricalConversionWarning: One or more series with value labels...
    Nr	   r   r   r   r   rP   3  r   rP   c                   @  r   )LossySetitemErrorzW
    Raised when trying to do a __setitem__ on an np.ndarray that is not lossless.
    Nr	   r   r   r   r   rQ   A  r   rQ   c                   @  r   )NoBufferPresentz^
    Exception is raised in _get_data_buffer to signal that there is no requested buffer.
    Nr	   r   r   r   r   rR   G  r   rR   c                   @  r   )InvalidComparisonz^
    Exception is raised by _validate_comparison_value to indicate an invalid comparison.
    Nr	   r   r   r   r   rS   M  r   rS   ))r   r   rK   rP   rI   rG   rL   r/   r   r-   r   rJ   r   rO   rS   r.   r   r@   rQ   r   rR   r   r,   r4   r   r   r   r   r   r   rH   rM   rA   rB   r1   r2   r0   r5   r   r   rN   )<r   
__future__r   rE   pandas._config.configr   pandas._libs.tslibsr   r   pandas.util.versionr   r$   r   r   Warningr   r   KeyErrorr   r   r   r   r   r   r   NotImplementedErrorr   	Exceptionr,   r-   r.   r/   r0   r1   r2   r3   _chained_assignment_msg	NameErrorr4   r5   r@   RuntimeErrorrA   rB   UserWarningrG   rH   rI   rJ   rK   OSErrorrL   rM   rN   rO   rP   rQ   rR   rS   __all__r   r   r   r   <module>   s^    	7)	
