| pandas.unique | CategoricalIndex.unique | Series.unique : Return unique values of Series object.
时间: 2024-05-30 18:09:33 浏览: 152
模块包含了一批用于技术指标计算的函数 (函数基本保持 参数为pandas.Series类型则返回值为pandas.Series类
`pandas.unique` and `Series.unique` are similar functions that return the unique values of a pandas Series object. The main difference is that `pandas.unique` can also be used with other pandas data structures like DataFrames and arrays, while `Series.unique` is specific to Series objects.
On the other hand, `CategoricalIndex.unique` returns the unique values of a pandas CategoricalIndex object, which is a specialized index type that allows for efficient storage and manipulation of categorical data.
In summary:
- Use `pandas.unique` or `Series.unique` to get the unique values of a Series object.
- Use `CategoricalIndex.unique` to get the unique values of a CategoricalIndex object.
阅读全文