pandas.errors.DuplicateLabelError
- exception pandas.errors.DuplicateLabelError[source]
-
Error raised when an operation would introduce duplicate labels.
New in version 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]
© 2008–2021, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/1.3.4/reference/api/pandas.errors.DuplicateLabelError.html