You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so we get the right kind of error on unhashables. simpler to do it here than directly in the indexing code.
In [29]: 1 in pd.Index([1, 2])
Out[29]: True
In [30]: [] in pd.Index([1, 2])
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-30-aed417339954> in <module>
----> 1 [] in pd.Index([1, 2])
/home/tsdist/vats_deployments/modeling.env.interactive-4d8c1c87-b253-4083-a330-ac480ba587f4/ts/modeling/environment/interactive/../../../../ext/public/python/pandas/1/0/5/dist/lib/python3.6/pandas/core/indexes/numeric.py in __contains__(self, key)
230 Check if key is a float and has a decimal. If it has, return False.
231 """
--> 232 hash(key)
233 try:
234 if is_float(key) and int(key) != key:
TypeError: unhashable type: 'list'
I have searched the [pandas] tag on StackOverflow for similar questions.
I have asked my usage related question on StackOverflow.
Question about pandas
In pandas.core.indexes.base
hash
is called here and the value is not used.Why is this done?
The text was updated successfully, but these errors were encountered: