Closed
Description
#59765 is the general issue about consistency in index lookups for missing values, but shorter term, we at least need to fix being able to lookup missing values for the future string dtype.
With object dtype, this works fine:
>>> idx = pd.Index(["a", "b", None])
>>> idx.get_loc(None)
2
But when enabling the string dtype, neither None or np.nan work as key:
>>> pd.options.future.infer_string = True
>>> idx = pd.Index(["a", "b", None])
>>> idx.get_loc(None)
...
KeyError: None
>>> idx.get_loc(np.nan)
...
KeyError: nan