We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34b0eb1 commit c3358f2Copy full SHA for c3358f2
pandas/core/indexes/numeric.py
@@ -9,6 +9,7 @@
9
is_bool,
10
is_bool_dtype,
11
is_scalar)
12
+from pandas.core.dtypes.missing import isna
13
14
from pandas import compat
15
from pandas.core import algorithms
@@ -114,6 +115,12 @@ def is_all_dates(self):
114
115
"""
116
return False
117
118
+ def insert(self, loc, item):
119
+ # treat NA values as nans:
120
+ if is_scalar(item) and isna(item):
121
+ item = np.nan
122
+ return super(NumericIndex, self).insert(loc, item)
123
+
124
125
_num_index_shared_docs['class_descr'] = """
126
Immutable ndarray implementing an ordered, sliceable set. The basic object
0 commit comments