[FEA] Define `__hash__` on CategoricalDtype
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
**Is your feature request related to a problem? Please describe.**
Would be nice if `hash(CategoricalDtype(...))` was supported
```
In [9]: import cudf
In [10]: import pandas
In [11]: hash(cudf.CategoricalDtype(list("abc")))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[11], line 1
----> 1 hash(cudf.CategoricalDtype(list("abc")))
TypeError: unhashable type: 'CategoricalDtype'
In [12]: hash(pandas.CategoricalDtype(list("abc")))
Out[12]: 1532899084736511412
```
**Describe the solution you'd like**
Define `__hash__` on `CategoricalDtype`
**Describe alternatives you've considered**
Custom hash based on order and categories
**Additional context**
Add any other context, code examples, or references to existing implementations about the feature request here.
Contributor guide
Assessment
This issue has not been assessed yet.