Skip to content

Commit a499ed8

Browse files
committed
restore order of null-handling section
1 parent ec2c7af commit a499ed8

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

pandas/core/arrays/datetimelike.py

+17-17
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,23 @@ def map(self, mapper):
748748
# ------------------------------------------------------------------
749749
# Null Handling
750750

751+
def isna(self):
752+
return self._isnan
753+
754+
@property # NB: override with cache_readonly in immutable subclasses
755+
def _isnan(self):
756+
"""
757+
return if each value is nan
758+
"""
759+
return (self.asi8 == iNaT)
760+
761+
@property # NB: override with cache_readonly in immutable subclasses
762+
def _hasnans(self):
763+
"""
764+
return if I have any nans; enables various perf speedups
765+
"""
766+
return bool(self._isnan.any())
767+
751768
def _maybe_mask_results(self, result, fill_value=iNaT, convert=None):
752769
"""
753770
Parameters
@@ -774,23 +791,6 @@ def _maybe_mask_results(self, result, fill_value=iNaT, convert=None):
774791
result[self._isnan] = fill_value
775792
return result
776793

777-
def isna(self):
778-
return self._isnan
779-
780-
@property # NB: override with cache_readonly in immutable subclasses
781-
def _isnan(self):
782-
"""
783-
return if each value is nan
784-
"""
785-
return (self.asi8 == iNaT)
786-
787-
@property # NB: override with cache_readonly in immutable subclasses
788-
def _hasnans(self):
789-
"""
790-
return if I have any nans; enables various perf speedups
791-
"""
792-
return bool(self._isnan.any())
793-
794794
def fillna(self, value=None, method=None, limit=None):
795795
# TODO(GH-20300): remove this
796796
# Just overriding to ensure that we avoid an astype(object).

0 commit comments

Comments
 (0)