We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 861c211 commit 9770e4eCopy full SHA for 9770e4e
pandas/core/dtypes/base.py
@@ -12,6 +12,7 @@
12
13
import numpy as np
14
15
+from pandas._libs.hashtable import object_hash
16
from pandas._typing import (
17
DtypeObj,
18
type_t,
@@ -128,7 +129,9 @@ def __eq__(self, other: Any) -> bool:
128
129
return False
130
131
def __hash__(self) -> int:
- return hash(tuple(getattr(self, attr) for attr in self._metadata))
132
+ # for python>=3.10, different nan objects have different hashes
133
+ # we need to avoid that und thus use hash function with old behavior
134
+ return object_hash(tuple(getattr(self, attr) for attr in self._metadata))
135
136
def __ne__(self, other: Any) -> bool:
137
return not self.__eq__(other)
0 commit comments