Sindbad~EG File Manager
�
Mٜgj � � � d Z ddlmZ ddlZddlmZ ddlmZmZ ddl m
Z
G d� de� Z G d � d
e� Z
G d� de� Z G d
� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� d e� Z G d!� d"e� Z G d#� d$e� Z G d%� d&e� Z G d'� d(e� Z G d)� d*e� Z! G d+� d,e� Z"d-Z#d.Z$d/Z%d0Z&d1� Z' G d2� d3e(� Z) G d4� d5e(� Z* G d6� d7e� Z+ G d8� d9e,� Z- G d:� d;e-� Z. G d<� d=e/� Z0 G d>� d?e� Z1 G d@� dAe� Z2 G dB� dCe� Z3 G dD� dEe� Z4 G dF� dGe5� Z6 G dH� dIe� Z7 G dJ� dKe� Z8 G dL� dMe� Z9 G dN� dOe� Z: G dP� dQe� Z; G dR� dSe� Z< G dT� dUe� Z=g dV�Z>y)Wz%
Expose public exceptions & warnings
� )�annotationsN)�OptionError)�OutOfBoundsDatetime�OutOfBoundsTimedelta)�InvalidVersionc � � e Zd ZdZy)�IntCastingNaNErrora1
Exception raised when converting (``astype``) an array with NaN to an integer type.
Examples
--------
>>> pd.DataFrame(np.array([[1, np.nan], [2, 3]]), dtype="i8")
Traceback (most recent call last):
IntCastingNaNError: Cannot convert non-finite values (NA or inf) to integer
N��__name__�
__module__�__qualname__�__doc__� � �A/usr/local/lib/python3.12/site-packages/pandas/errors/__init__.pyr r � � �r r c � � e Zd ZdZy)�NullFrequencyErrorao
Exception raised when a ``freq`` cannot be null.
Particularly ``DatetimeIndex.shift``, ``TimedeltaIndex.shift``,
``PeriodIndex.shift``.
Examples
--------
>>> df = pd.DatetimeIndex(["2011-01-01 10:00", "2011-01-01"], freq=None)
>>> df.shift(2)
Traceback (most recent call last):
NullFrequencyError: Cannot shift with no freq
Nr
r r r r r � � �r r c � � e Zd ZdZy)�PerformanceWarningaT
Warning raised when there is a possible performance impact.
Examples
--------
>>> df = pd.DataFrame({"jim": [0, 0, 1, 1],
... "joe": ["x", "x", "z", "y"],
... "jolie": [1, 2, 3, 4]})
>>> df = df.set_index(["jim", "joe"])
>>> df
jolie
jim joe
0 x 1
x 2
1 z 3
y 4
>>> df.loc[(1, 'z')] # doctest: +SKIP
# PerformanceWarning: indexing past lexsort depth may impact performance.
df.loc[(1, 'z')]
jolie
jim joe
1 z 3
Nr
r r r r r . s � �r r c � � e Zd ZdZy)�UnsupportedFunctionCalla
Exception raised when attempting to call a unsupported numpy function.
For example, ``np.cumsum(groupby_object)``.
Examples
--------
>>> df = pd.DataFrame({"A": [0, 0, 1, 1],
... "B": ["x", "x", "z", "y"],
... "C": [1, 2, 3, 4]}
... )
>>> np.cumsum(df.groupby(["A"]))
Traceback (most recent call last):
UnsupportedFunctionCall: numpy operations are not valid with groupby.
Use .groupby(...).cumsum() instead
Nr
r r r r r H � � �r r c � � e Zd ZdZy)�UnsortedIndexErrora�
Error raised when slicing a MultiIndex which has not been lexsorted.
Subclass of `KeyError`.
Examples
--------
>>> df = pd.DataFrame({"cat": [0, 0, 1, 1],
... "color": ["white", "white", "brown", "black"],
... "lives": [4, 4, 3, 7]},
... )
>>> df = df.set_index(["cat", "color"])
>>> df
lives
cat color
0 white 4
white 4
1 brown 3
black 7
>>> df.loc[(0, "black"):(1, "white")]
Traceback (most recent call last):
UnsortedIndexError: 'Key length (2) was greater
than MultiIndex lexsort depth (1)'
Nr
r r r r r [ s � �r r c � � e Zd ZdZy)�ParserErrora�
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.
Examples
--------
>>> data = '''a,b,c
... cat,foo,bar
... dog,foo,"baz'''
>>> from io import StringIO
>>> pd.read_csv(StringIO(data), skipfooter=1, engine='python')
Traceback (most recent call last):
ParserError: ',' expected after '"'. Error could possibly be due
to parsing errors in the skipped footer rows
Nr
r r r r r v s � �r r c � � e Zd ZdZy)�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 � s � �3r r c � � e Zd ZdZy)�EmptyDataErrora!
Exception raised in ``pd.read_csv`` when empty data or header is encountered.
Examples
--------
>>> from io import StringIO
>>> empty = StringIO()
>>> pd.read_csv(empty)
Traceback (most recent call last):
EmptyDataError: No columns to parse from file
Nr
r r r r"