Skip to content

Commit 573fee6

Browse files
committed
Make _na_value a class attribute.
1 parent 1b3f381 commit 573fee6

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

pandas/core/index.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,8 @@ def values(self):
393393
def get_values(self):
394394
return self.values
395395

396-
def _na_value(self):
397-
# The expected NA value to use with this index.
398-
return np.nan
396+
_na_value = np.nan
397+
"""The expected NA value to use with this index."""
399398

400399
@property
401400
def is_monotonic(self):
@@ -2261,7 +2260,7 @@ def get_level_values(self, level):
22612260
unique_vals = self.levels[num] # .values
22622261
labels = self.labels[num]
22632262
values = Index(com.take_1d(unique_vals.values, labels,
2264-
fill_value=unique_vals._na_value()))
2263+
fill_value=unique_vals._na_value))
22652264
values.name = self.names[num]
22662265
return values
22672266

pandas/tseries/index.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,8 @@ def _mpl_repr(self):
495495
# how to represent ourselves to matplotlib
496496
return tslib.ints_to_pydatetime(self.asi8, self.tz)
497497

498-
def _na_value(self):
499-
# The expected NA value to use with this index.
500-
return tslib.NaT
498+
_na_value = tslib.NaT
499+
"""The expected NA value to use with this index."""
501500

502501
def __unicode__(self):
503502
from pandas.core.format import _format_datetime64

0 commit comments

Comments
 (0)