pandas.
Flags
Flags that apply to pandas objects.
New in version 1.2.0.
The object these flags are associated with.
Whether to allow duplicate labels in this object. By default, duplicate labels are permitted. Setting this to False will cause an errors.DuplicateLabelError to be raised when index (or columns for DataFrame) is not unique, or any subsequent operation on introduces duplicates. See Disallowing Duplicate Labels for more.
False
errors.DuplicateLabelError
Warning
This is an experimental feature. Currently, many methods fail to propagate the allows_duplicate_labels value. In future versions it is expected that every method taking or returning one or more DataFrame or Series objects will propagate allows_duplicate_labels.
allows_duplicate_labels
Notes
Attributes can be set in two ways
>>> df = pd.DataFrame() >>> df.flags <Flags(allows_duplicate_labels=True)> >>> df.flags.allows_duplicate_labels = False >>> df.flags <Flags(allows_duplicate_labels=False)>
>>> df.flags['allows_duplicate_labels'] = True >>> df.flags <Flags(allows_duplicate_labels=True)>
Attributes
Whether this object allows duplicate labels.