用法:
property Index.has_duplicates
檢查索引是否有重複值。
- bool
索引是否具有重複值。
返回:
例子:
>>> idx = pd.Index([1, 5, 7, 7]) >>> idx.has_duplicates True
>>> idx = pd.Index([1, 5, 7]) >>> idx.has_duplicates False
>>> idx = pd.Index(["Watermelon", "Orange", "Apple", ... "Watermelon"]).astype("category") >>> idx.has_duplicates True
>>> idx = pd.Index(["Orange", "Apple", ... "Watermelon"]).astype("category") >>> idx.has_duplicates False
相關用法
- Python pandas.Index.value_counts用法及代碼示例
- Python pandas.Index.argmin用法及代碼示例
- Python pandas.Index.is_categorical用法及代碼示例
- Python pandas.Index.to_series用法及代碼示例
- Python pandas.Index.str用法及代碼示例
- Python pandas.Index.to_numpy用法及代碼示例
- Python pandas.Index.is_object用法及代碼示例
- Python pandas.Index.slice_indexer用法及代碼示例
- Python pandas.Index.is_interval用法及代碼示例
- Python pandas.Index.notnull用法及代碼示例
- Python pandas.Index.equals用法及代碼示例
- Python pandas.Index.set_names用法及代碼示例
- Python pandas.Index.searchsorted用法及代碼示例
- Python pandas.Index.duplicated用法及代碼示例
- Python pandas.Index.is_monotonic_increasing用法及代碼示例
- Python pandas.Index.min用法及代碼示例
- Python pandas.Index.is_monotonic_decreasing用法及代碼示例
- Python pandas.Index.max用法及代碼示例
- Python pandas.Index.shift用法及代碼示例
- Python pandas.Index.argmax用法及代碼示例
注:本文由純淨天空篩選整理自pandas.pydata.org大神的英文原創作品 pandas.Index.has_duplicates。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。