1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
U
¬ý°d×Mã)@sþdZddlmZddlZddlmZddlmZmZddl    m
Z
Gdd„de ƒZ Gd    d
„d
e ƒZ Gd d „d eƒZGd d„de ƒZGdd„deƒZGdd„de ƒZGdd„deƒZGdd„de ƒZGdd„deƒZGdd„de ƒZGdd„deƒZGdd„deƒZGdd „d eƒZGd!d"„d"e ƒZGd#d$„d$eƒZGd%d&„d&eƒZGd'd(„d(eƒZ Gd)d*„d*e ƒZ!Gd+d,„d,eƒZ"Gd-d.„d.eƒZ#d/Z$Gd0d1„d1e%ƒZ&Gd2d3„d3e%ƒZ'Gd4d5„d5eƒZ(Gd6d7„d7e)ƒZ*Gd8d9„d9e*ƒZ+Gd:d;„d;e,ƒZ-Gd<d=„d=eƒZ.Gd>d?„d?eƒZ/Gd@dA„dAeƒZ0GdBdC„dCeƒZ1GdDdE„dEe2ƒZ3GdFdG„dGeƒZ4GdHdI„dIeƒZ5GdJdK„dKeƒZ6GdLdM„dMeƒZ7GdNdO„dOeƒZ8GdPdQ„dQeƒZ9GdRdS„dSeƒZ:dddCdMd?d;dEd&dd"ddAddKdSd$dTd5dOddQd
d d1dUdVdWddd d=dGd7d9d*d,d(d3dddIg)Z;dS)Xz%
Expose public exceptions & warnings
é)Ú annotationsN)Ú OptionError)ÚOutOfBoundsDatetimeÚOutOfBoundsTimedelta)ÚInvalidVersionc@seZdZdZdS)ÚIntCastingNaNErrorz]
    Exception raised when converting (``astype``) an array with NaN to an integer type.
    N©Ú__name__Ú
__module__Ú __qualname__Ú__doc__©r r úMd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/errors/__init__.pyrsrc@seZdZdZdS)ÚNullFrequencyErrorzš
    Exception raised when a ``freq`` cannot be null.
 
    Particularly ``DatetimeIndex.shift``, ``TimedeltaIndex.shift``,
    ``PeriodIndex.shift``.
    Nrr r r rrsrc@seZdZdZdS)ÚPerformanceWarningzE
    Warning raised when there is a possible performance impact.
    Nrr r r rr!src@seZdZdZdS)ÚUnsupportedFunctionCallz
    Exception raised when attempting to call a unsupported numpy function.
 
    For example, ``np.cumsum(groupby_object)``.
    Nrr r r rr'src@seZdZdZdS)ÚUnsortedIndexErrorzk
    Error raised when slicing a MultiIndex which has not been lexsorted.
 
    Subclass of `KeyError`.
    Nrr r r rr/src@seZdZdZdS)Ú 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.
    Nrr r r rr7src@seZdZdZdS)Ú 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.
    Nrr r r rrEsrc@seZdZdZdS)ÚEmptyDataErrorzW
    Exception raised in ``pd.read_csv`` when empty data or header is encountered.
    Nrr r r rr|src@seZdZdZdS)Ú 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')
    Nrr r r rr‚src@seZdZdZdS)Ú
MergeErrorzN
    Exception raised when merging data.
 
    Subclass of ``ValueError``.
    Nrr r r rr«src@seZdZdZdS)ÚAccessorRegistrationWarningzC
    Warning for attribute conflicts in accessor registration.
    Nrr r r rr³src@s0eZdZdZd dddœdd„Zddœd    d
„Zd S) ÚAbstractMethodErrorzO
    Raise this error instead of NotImplementedError for abstract methods.
    ÚmethodÚstrÚNone)Ú
methodtypeÚreturncCs:ddddh}||kr*td|›d|›dƒ‚||_||_dS)NrÚ classmethodÚ staticmethodÚpropertyzmethodtype must be one of z, got z     instead.)Ú
ValueErrorrÚclass_instance)Úselfr#rÚtypesr r rÚ__init__¾s ÿzAbstractMethodError.__init__)rcCs2|jdkr|jj}n t|jƒj}d|j›d|›S)NrzThis z' must be defined in the concrete class )rr#r    Útype)r$Únamer r rÚ__str__Çs
 
 zAbstractMethodError.__str__N)r)r    r
r r r&r)r r r rr¹s    rc@seZdZdZdS)ÚNumbaUtilErrorz=
    Error raised for unsupported Numba engine routines.
    Nrr r r rr*Ïsr*c@seZdZdZdS)Ú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]
    Nrr r r rr+Õsr+c@seZdZdZdS)ÚInvalidIndexErrorzd
    Exception raised when attempting to use an invalid index key.
 
    .. versionadded:: 1.1.0
    Nrr r r rr,êsr,c@seZdZdZdS)Ú    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.
    Nrr r r rr-òsr-c@seZdZdZdS)Ú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
    Nrr r r rr.ûsr.c@seZdZdZdS)Ú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...
    Nrr r r rr/sr/c@seZdZdZdS)Ú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...
    Nrr r r rr0-sr0c@seZdZdZdS)Ú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
    Nrr r r rr1Csr1aA 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@seZdZdZdS)Ú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...
    Nrr r r rr2hsr2cs,eZdZdZd    ddddœ‡fdd„ Z‡ZS)
Ú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
    Nrz bool | Noner)r(Úis_localrcs8t|ƒ›d}|rd|›}n
d|›}tƒ |¡dS)Nz is not definedzlocal variable zname )ÚreprÚsuperr&)r$r(r4Zbase_msgÚmsg©Ú    __class__r rr&Œs
 
zUndefinedVariableError.__init__)N©r    r
r r r&Ú __classcell__r r r8rr3{sr3c@seZdZdZdS)Ú 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
    Nrr r r rr<•sr<c@seZdZdZdS)ÚPyperclipExceptionzƒ
    Exception raised when clipboard functionality is unsupported.
 
    Raised by ``to_clipboard()`` and ``read_clipboard()``.
    Nrr r r rr=ªsr=cs(eZdZdZdddœ‡fdd„ Z‡ZS)Ú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.
    rr)Úmessagercs$|dt ¡›d7}tƒ |¡dS)Nz (ú))ÚctypesÚWinErrorr6r&)r$r?r8r rr&ºsz"PyperclipWindowsException.__init__r:r r r8rr>²sr>c@seZdZdZdS)Ú
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)
    Nrr r r rrCÀsrCc@seZdZdZdS)Ú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]...
    Nrr r r rrDÓsrDc@seZdZdZdS)Ú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!
    Nrr r r rrEßsrEc@seZdZdZdS)ÚIncompatibilityWarningzX
    Warning raised when trying to use where criteria on an incompatible HDF5 file.
    Nrr r r rrFìsrFc@seZdZdZdS)Ú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.
    Nrr r r rrGòsrGc@seZdZdZdS)Ú 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
    Nrr r r rrHüsrHc@seZdZdZdS)Ú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...
    Nrr r r rrI    srIc@seZdZdZdS)Ú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...
    Nrr r r rrJsrJc@seZdZdZdS)Ú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...
    Nrr r r rrK$srKc@seZdZdZdS)Ú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...
    Nrr r r rrL3srLc@seZdZdZdS)ÚLossySetitemErrorzW
    Raised when trying to do a __setitem__ on an np.ndarray that is not lossless.
    Nrr r r rrMAsrMc@seZdZdZdS)ÚNoBufferPresentz^
    Exception is raised in _get_data_buffer to signal that there is no requested buffer.
    Nrr r r rrNGsrNc@seZdZdZdS)ÚInvalidComparisonz^
    Exception is raised by _validate_comparison_value to indicate an invalid comparison.
    Nrr r r rrOMsrOrrrr)<r Ú
__future__rrAZpandas._config.configrZpandas._libs.tslibsrrZpandas.util.versionrr"rrÚWarningrrÚKeyErrorrrrrrrrÚNotImplementedErrorrÚ    Exceptionr*r+r,r-r.r/r0r1Z_chained_assignment_msgÚ    NameErrorr2r3r<Ú RuntimeErrorr=r>Ú UserWarningrCrDrErFrGÚOSErrorrHrIrJrKrLrMrNrOÚ__all__r r r rÚ<module>s®       7)    ÿ  
  ×